-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authenticate issue with EKS cluster using latest version v32.0.0 #2333
Comments
This can be avoided by downgrading to 31.0.0 |
Downgrading to 31.0.0 also works for me. |
same! broke our CI pipes |
Same with AKS, downgrading to 31.0.0 helps. |
Same on GKE
|
Observing a slightly different error but root cause may be similar, I'm observing a 401 unauthorized when connecting to AKS with SP client/secret. I've debugged it to see where was the difference with the previous version and it turned out to be the In my case it's failing when calling |
This switches the project to use PEP 440 compatible metadata instead of the Poetry specific configuration. As part of this the version of the Kubernetes library was limited to 31.* since the most recent 32.0.0 release seems to break authentication: - kubernetes-client/python#2333 - kubernetes-client/python#2334
I just came across this issue :) Here is a workaround in case some one wants from kubernetes.config import kube_config as k8config
from kubernetes.config.exec_provider import ExecProvider
class AWSExecProvider(ExecProvider):
def __init__(self, exec_config, cwd, cluster=None) -> None:
super().__init__(exec_config, cwd, cluster)
if isinstance(self.args, list):
self.args = " ".join(self.args)
k8config.ExecProvider = AWSExecProvider
api_client = k8config.new_client_from_config_dict()
client = k8client.CoreV1Api(api_client)
client.list_namespaced_pods("default") |
Same here, AKS kubernetes version config.load_kube_config()
api = client.CoreV1Api()
pods = api.list_namespaced_pod(namespace) Getting the following error: 2025-01-27T16:36:00.6511896Z if not 200 <= r.status <= 299:
2025-01-27T16:36:00.6512295Z > raise ApiException(http_resp=r)
2025-01-27T16:36:00.6512712Z E kubernetes.client.exceptions.ApiException: (401)
2025-01-27T16:36:00.6513132Z E Reason: Unauthorized
2025-01-27T16:36:00.6513832Z E HTTP response headers: HTTPHeaderDict({'Audit-Id': '98668c59-8242-46dd-bcb3-2b43e08729bc', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'Date': 'Mon, 27 Jan 2025 16:35:59 GMT', 'Content-Length': '129'})
2025-01-27T16:36:00.6514912Z E HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Unauthorized","reason":"Unauthorized","code":401} The solution to downgrade to version 26 |
I don't think shell=True works when passing a list to Popen() |
What happened (please include outputs or screenshots):
Error when trying to list EKS nodes or pods
What you expected to happen:
Should be able to list node just fine with function
api.list_node()
How to reproduce it (as minimally and precisely as possible):
Create EKS cluster
Install kubernetes package version v32.0.0
Run following
Anything else we need to know?:
It was working fine with version v31.0.0 but failed after upgrading to version v32.0.0
Environment:
kubectl version
): v1.32.0python --version
) Python 3.10.12pip list | grep kubernetes
) v32.0.0The text was updated successfully, but these errors were encountered: