Skip to content

Commit 13eddd7

Browse files
docs(k8s): Simplify tunnel secret creation in deployment guide (cloudflare#25751)
-In the Kubernetes deployment guide for Cloudflare Tunnel, this change simplifies how the tunnel token is stored in a secret. -The guide is updated to use the `stringData` field instead of the `data` field in the Kubernetes Secret manifest. -This allows users to provide the tunnel token as a plain string without needing to manually base64 encode it, making the process easier and less prone to errors.
1 parent 513a810 commit 13eddd7

File tree

1 file changed

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

1 file changed

+7
-19
lines changed

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

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -169,38 +169,26 @@ Leave the Cloudflare Tunnel browser tab open while we focus on the Kubernetes de
169169

170170
## 4. Store the tunnel token
171171

172-
`cloudflared` uses a tunnel token to run a remotely-managed Cloudflare Tunnel. You can store the tunnel token in a [Kubernetes secret](https://kubernetes.io/docs/concepts/configuration/secret/), which requires data to be encoded as a base64-encoded string. The encoding is not meant to protect the token from being read but to allow for the safe handling of binary data within Kubernetes.
172+
`cloudflared` uses a tunnel token to run a remotely-managed Cloudflare Tunnel. You can store the tunnel token in a [Kubernetes secret](https://kubernetes.io/docs/concepts/configuration/secret/).
173173

174-
1. Convert the tunnel token into base64 format:
175-
176-
```sh
177-
'eyJhIjoiNWFiNGU5Z...' | base64
178-
```
179-
180-
```sh output
181-
ZXlKa...NKOQo=
182-
```
183-
184-
2. In GKE Cloud Shell, create a `tunnel-token.yaml` file with the following content. Make sure to replace `<base64_tunnel_token>` with your base64-encoded token value (`ZXlKa...NKOQo=`).
174+
1. In GKE Cloud Shell, create a `tunnel-token.yaml` file with the following content. Make sure to replace `<YOUR_TUNNEL_TOKEN>` with your tunnel token (`eyJhIjoiNWFiNGU5Z...`).
185175

186176
```yaml title="tunnel-token.yaml"
187177
apiVersion: v1
188-
data:
189-
token: <base64_tunnel_token>
190178
kind: Secret
191179
metadata:
192-
name: tunnel-token
193-
namespace: default
194-
type: Opaque
180+
name: tunnel-token
181+
stringData:
182+
token: <YOUR_TUNNEL_TOKEN>
195183
```
196184

197-
3. Create the secret:
185+
2. Create the secret:
198186

199187
```sh
200188
kubectl create -f tunnel-token.yaml
201189
```
202190

203-
4. Check the newly created secret:
191+
3. Check the newly created secret:
204192

205193
```sh
206194
kubectl get secrets

0 commit comments

Comments
 (0)