Use Cloudflare Tunnels with Kubernetes client-go plugin

Hello, I followed this tutorial to get kubectl working from my machine to a Kubernetes pod via a tunnel and an Access application: https://developers.cloudflare.com/cloudflare-one/tutorials/tunnel-kubectl/ However, when I run kubectl get pods, Cloudflare sends me to the login page even though I have a valid token (I tested the token). From what I understand, kubectl is making the following call:
curl -v -XGET \
-H "Accept: application/json;g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList,application/json;g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList,application/json" \
-H "User-Agent: kubectl/v1.32.2 (darwin/arm64) kubernetes/67a30c0" \
'https://[domain.com]/api?timeout=32s'
curl -v -XGET \
-H "Accept: application/json;g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList,application/json;g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList,application/json" \
-H "User-Agent: kubectl/v1.32.2 (darwin/arm64) kubernetes/67a30c0" \
'https://[domain.com]/api?timeout=32s'
(I’m using a real domain), but it never provides the token at any point! Could you help me? Thanks!
Cloudflare Docs
Use Cloudflare Tunnels with Kubernetes client-go plugin · Cloudflar...
This tutorial explains how to use Cloudflare Tunnels with Kubernetes client-go credential plugins for authentication. By following these steps, you can securely access your Kubernetes cluster through a Cloudflare Tunnel using the kubectl command-line tool.
2 Replies
Endo
EndoOP6d ago
@Cyb3r-Jok3 Sorry to tag you, but do you have any idea for my issue or do you know someone at Cloudflare who could help me? 🙂 Thanks
Cyb3r-Jak3
Cyb3r-Jak36d ago
I have not used cloudflared with kubectl sorry

Did you find this page helpful?