Skip to content

Commit 20ef081

Browse files
committed
define TUNNEL_TOKEN env variable
1 parent ffe8602 commit 20ef081

File tree

1 file changed

+5
-7
lines changed
  • src/content/docs/cloudflare-one/connections/connect-networks/deployment-guides

1 file changed

+5
-7
lines changed

src/content/docs/cloudflare-one/connections/connect-networks/deployment-guides/kubernetes.mdx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,14 @@ To run the Cloudflare Tunnel in Kubernetes:
242242
- image: cloudflare/cloudflared:latest
243243
name: cloudflared
244244
env:
245-
- name: token_value
245+
# Defines an environment variable for the tunnel token.
246+
- name: TUNNEL_TOKEN
246247
valueFrom:
247248
secretKeyRef:
248249
name: tunnel-token
249250
key: token
250251
command:
251-
# Parameters must be in the correct order relative to the "run" command.
252+
# Configures tunnel run parameters
252253
- cloudflared
253254
- tunnel
254255
- --no-autoupdate
@@ -257,9 +258,6 @@ To run the Cloudflare Tunnel in Kubernetes:
257258
- --metrics
258259
- 0.0.0.0:2000
259260
- run
260-
args:
261-
- --token
262-
- $(token_value)
263261
livenessProbe:
264262
httpGet:
265263
# Cloudflared has a /ready endpoint which returns 200 if and only if
@@ -277,7 +275,7 @@ To run the Cloudflare Tunnel in Kubernetes:
277275
kubectl create -f tunnel.yaml
278276
```
279277

280-
Kubernetes will install the `cloudflared` image on two pods and run the tunnel using the command `cloudflared tunnel --no-autoupdate --loglevel debug --metrics 0.0.0.0:2000 run --token eyJhIjoiNWFiNGU5Z...`
278+
Kubernetes will install the `cloudflared` image on two pods and run the tunnel using the command `cloudflared tunnel --no-autoupdate --loglevel debug --metrics 0.0.0.0:2000 run`. `cloudflared` will consume the tunnel token from the `TUNNEL_TOKEN` environment variable.
281279

282280
3. Check the status of your cluster:
283281

@@ -305,7 +303,7 @@ To run the Cloudflare Tunnel in Kubernetes:
305303
replicaset.apps/httpbin-deployment-bc6689c5d 2 2 2 3m37s
306304
```
307305

308-
You should see two `cloudflared` pods and two `httpbin` pods with a `Running` status. If your `cloudflared` pods keep restarting, make sure that your `cloudflared` [run parameters](/cloudflare-one/connections/connect-networks/configure-tunnels/cloudflared-parameters/run-parameters/) are in the correct order. In the example above, `--loglevel`, `--no-autoupdate`, and `--metrics` should come before the `run` command, while `--token` comes after the `run` command.
306+
You should see two `cloudflared` pods and two `httpbin` pods with a `Running` status. If your `cloudflared` pods keep restarting, check the `command` syntax in `tunnel.yaml` and make sure that the [tunnel run parameters](/cloudflare-one/connections/connect-networks/configure-tunnels/cloudflared-parameters/run-parameters/) are in the correct order.
309307

310308
## 6. Verify tunnel status
311309

0 commit comments

Comments
 (0)