Hi dear community,
I’ve just tried the procedure outlined here https://developers.cloudflare.com/access/other-protocols/kubectl/ to get my K8S cluster working with Cloudflare access.
I found out that the when the first command run and a web page is opened to get the token the procedure doesn’t work:
> cloudflared tunnel --hostname k8s-dev.test.net --url tcp://my.kubernetes.ip:443 --socks5=true
...
....
> cloudflared access tcp --hostname k8s-dev.test.net --url 127.0.0.1:9999
INFO[0000] Start Websocket listener on: 127.0.0.1:9999
> alias kubeone="env HTTPS_PROXY=socks5://127.0.0.1:9999 kubectl"
> kubeone get ns
Failed to connect to proxy URL: "http://socks5://127.0.0.1:9999"
Failed to connect to proxy URL: "http://socks5://127.0.0.1:9999"
Failed to connect to proxy URL: "http://socks5://127.0.0.1:9999"
Failed to connect to proxy URL: "http://socks5://127.0.0.1:9999"
Failed to connect to proxy URL: "http://socks5://127.0.0.1:9999"
Unable to connect to the server: getting credentials: exec: exit status 255
But I I redo the same things with the last alias changed with HTTP_PROXY:
> cloudflared tunnel --hostname k8s-dev.test.net --url tcp://my.kubernetes.ip:443 --socks5=true
...
....
> cloudflared access tcp --hostname k8s-dev.test.net --url 127.0.0.1:9999
INFO[0000] Start Websocket listener on: 127.0.0.1:9999
A browser window should have opened at the following URL:
https://k8s-dev.test.net/cdn-cgi/access/cli?redirect_url=........
If the browser failed to open, please visit the URL above directly in your browser.
> alias kubeone="env HTTP_PROXY=socks5://127.0.0.1:9999 kubectl"
> kubeone get ns
NAME STATUS AGE
default Active 19h
...
At this point I can change the alias back to HTTPS_PROXY and everything will work as expected. Something is going weird with the proxy and the authentication phase.
Please can advise on it?
Best Regards