-
Notifications
You must be signed in to change notification settings - Fork 93
kubectl exec through kube-oidc-proxy fails #150
Comments
Hi @smurfralf, This indeed is a network issue rather than an auth one from what I can see. The latest release v0.3.0 included a change to enable a flush interval for long running connections however it looks like we are failing on a POST request here which is odd. Would you be able to upgrade the image tag (there should't be any breaking changes), and increase the log level of the proxy (--v=10), and report back with the output? (don't forget it remove any secrets! 😬). |
Hi @JoshVanL I'm experiencing the same issue however with a different error message.
I increased the log level of the proxy (--v=10) and this is the output for those requests
The proxy is running on EKS behind an ALB. Besides exec and port-forward, i'm able to run the other kubectl commands like |
Hi, we've got the same issue. Tried to expose the service on ELBs and ALBs and get the same output as the previous comment (except for hostnames). It works for everything except for |
Hi @sebastienc . You can't run it behind ALB / ELB in AWS. |
@hazmei My kube-apiserver is exposed thru nginx ingress.
My question is how to configure this protocol in these 2 layers? |
Hi, I also have the same issue, but the log is different. I'm getting a 403 error. I'm using kube-oidc-proxy 0.3.0. I can't do port-forwarding. I'm using Istio -> Nginx Ingress -> kube-oidc-proxy. |
here are the logs: |
I also get Any solution for this? k port-forward -n xxx pod/redis-master-0 6379:6379 --v=6
I0921 17:31:52.061926 18020 loader.go:373] Config loaded from file: /Users/xxx/.kube/config
I0921 17:31:52.634821 18020 round_trippers.go:553] GET https://oidc-proxy.xxx/api/v1/namespaces/xxx/pods/redis-master-0 200 OK in 542 milliseconds
I0921 17:31:52.799925 18020 round_trippers.go:553] GET https://oidc-proxy.xxx/api/v1/namespaces/xxx/pods/redis-master-0 200 OK in 127 milliseconds
I0921 17:31:53.149233 18020 round_trippers.go:553] POST https://oidc-proxy.xxx/api/v1/namespaces/xxx/pods/redis-master-0/portforward 403 Forbidden in 345 milliseconds
error: error upgrading connection: kubectl exec -it pod/kube-oidc-proxy-kube-oidc-proxy-8555dc5985-22b8k -n kube-oidc-proxy --v=6 -- /bin/bash
I0921 17:25:35.897751 17912 loader.go:373] Config loaded from file: /Users/xxx/.kube/config
I0921 17:25:36.394211 17912 round_trippers.go:553] GET https://oidc-proxy.xxx/api/v1/namespaces/kube-oidc-proxy/pods/kube-oidc-proxy-kube-oidc-proxy-8555dc5985-22b8k 200 OK in 486 milliseconds
I0921 17:25:36.397416 17912 podcmd.go:88] Defaulting container name to kube-oidc-proxy-kube-oidc-proxy
I0921 17:25:36.741460 17912 round_trippers.go:553] POST https://oidc-proxy.xxx/api/v1/namespaces/kube-oidc-proxy/pods/kube-oidc-proxy-kube-oidc-proxy-8555dc5985-22b8k/exec?command=%2Fbin%2Fbash&container=kube-oidc-proxy-kube-oidc-proxy&stdin=true&stdout=true&tty=true 403 Forbidden in 343 milliseconds
I0921 17:25:36.741959 17912 helpers.go:246] server response object: [{
"metadata": {}
}]
Error from server: |
I'm also seeing this exact problem with NGINX... anybody have success yet? |
In my case oidc-proxy is behind self-hosted NGINX balancer. And for kubectl-exec mode connection should be upgraded from regular HTTP/1.1 to WebSocket. So adding this to NGINX config fixed the problem:
|
for Istio the fix is to apply the following
|
I have a working kube-oidc-proxy instance but when I try to run
kubectl exec -it
I get a failure. Iskubectl exec -it
supported by the proxy?Here is what I ran and the result:
If make a request directly to the apiserver, it succeeds and I get a shell prompt inside the pod. But of course they are different users, since the direct call is using x509 authentication. However the kube-oidc-proxy user has a role with wildcards for every rule, I don't think permissions are the cause. There are no entries related to the request in the kube-oidc-proxy pod logs.
The image I'm using is
quay.io/jetstack/kube-oidc-proxy:v0.2.0
The text was updated successfully, but these errors were encountered: