Create secret for Cloudflared tunnel token
bash
1kubectl create namespace cloudflare2
3kubectl create secret generic cloudflared-token \4 --from-literal=token=YOUR_TUNNEL_TOKEN \5 -n cloudflareCreate deployment and service
bash
1nano cloudflared-deployment.yamlyaml
1apiVersion: apps/v12kind: Deployment3metadata:4 name: cloudflared5 namespace: cloudflare6spec:7 replicas: 28 selector:9 matchLabels:10 app: cloudflared11 template:12 metadata:13 labels:14 app: cloudflared15 spec:16 containers:17 - name: cloudflared18 image: cloudflare/cloudflared:latest19 args:20 - tunnel21 - run22 env:23 - name: TUNNEL_TOKEN24 valueFrom:25 secretKeyRef:26 name: cloudflared-token27 key: tokenChange hostname where point to
bash
1Service: http://your-service-name.namespace.svc.cluster.local:port2
3### Example:4http://myapp.default.svc.cluster.local:80805http://nginx.default.svc.cluster.local:80.6http://code-server.codelearn.svc.cluster.local:80