int128 / kubelogin

kubectl plugin for Kubernetes OpenID Connect authentication (kubectl oidc-login)
Apache License 2.0
1.7k stars 193 forks source link

Access to identity provider behind SOCKS proxy #1081

Open ktarplee opened 5 months ago

ktarplee commented 5 months ago

Describe the question

Is it possible to configure kubectl-oidc_login to use a SOCKS5 proxy when connecting to the --oidc-issuer-url?

Rationale

I have a Kubernetes cluster that is running Gitlab. Gitlab is the OIDC identity provider for the cluster's kube-apiserver. All access to the cluster is through SOCKS5 (via ssh -D 9999 cluster-login-node). When I have credentials set in the kubeconfig file I can easily set the proxy-url: socks5://localhost:9999 in the cluster section of my kubeconfig and kubectl works as expected.

The issue comes when I want to use kubectl-oidc_login. It does not seem to support SOCKS5 proxies for access to the identity provider.

To implement this in kubectl-oidc_login it looks like some code similar to this is necessary.