Skip to content
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

load_kube_config not working in OCI #2354

Open
gmares007 opened this issue Feb 17, 2025 · 1 comment
Open

load_kube_config not working in OCI #2354

gmares007 opened this issue Feb 17, 2025 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@gmares007
Copy link

What happened (please include outputs or screenshots):

By just updating version 31 to 32 start to failing
pip install kubernetes --upgrade

python code

import kubernetes
print(kubernetes.version)

from kubernetes import config, client
config.load_kube_config(config_file="admin.config")

k8s_api = client.CoreV1Api()
print(k8s_api.list_node().items)

Sanity test failure:

18:43:49 [2025-01-27T13:13:49.229Z] 2025-01-27 13:13:48 INFO ControlPlane Validation
18:43:49 [2025-01-27T13:13:49.229Z] 2025-01-27 13:13:48 INFO Kubeconfig file found: /u01/jenkins/builds/pcaoke-terraform-runs/automation/workflow2/workflow2.config
18:43:49 [2025-01-27T13:13:49.484Z] 2025-01-27 13:13:49 ERROR exec: failed to decode process output: Expecting value: line 1 column 1 (char 0)
18:43:49 [2025-01-27T13:13:49.740Z] 2025-01-27 13:13:49 INFO Sanity test failed!
18:43:49 [2025-01-27T13:13:49.740Z] Unexpected error: (403)
18:43:49 [2025-01-27T13:13:49.740Z] Reason: Forbidden
18:43:49 [2025-01-27T13:13:49.740Z] HTTP response headers: HTTPHeaderDict({'Audit-Id': '9ead31fa-772b-4684-9ae5-04b23edd5700', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'X-Content-Type-Options': 'nosniff', 'X-Kubernetes-Pf-Flowschema-Uid': '9275478a-b4d2-4490-b796-e34dae0d0567', 'X-Kubernetes-Pf-Prioritylevel-Uid': 'd9ebd08e-f5b5-44ca-9f00-9ae465fd44a7', 'Date': 'Mon, 27 Jan 2025 13:13:49 GMT', 'Content-Length': '256'})
18:43:49 [2025-01-27T13:13:49.740Z] HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"nodes is forbidden: User "system:anonymous" cannot list resource "nodes" in API group "" at the cluster scope","reason":"Forbidden","details":{"kind":"nodes"},"code":403}

What you expected to happen:
config file is loaded correctly and the list of kubernetes nodes is displayed

How to reproduce it (as minimally and precisely as possible):
Above the test and trace

Anything else we need to know?:
Only change was

Environment:

  • Kubernetes version (kubectl version): 1.29.2
  • OS (e.g., MacOS 10.13.6):Sequoia 15.3 (The same with Oracle Linux 8.0)
  • Python version (python --version) 3.11
  • Python client version (pip list | grep kubernetes) 32
@gmares007 gmares007 added the kind/bug Categorizes issue or PR as related to a bug. label Feb 17, 2025
@rajkumarmano
Copy link

rajkumarmano commented Feb 18, 2025

this is related to #2334. Please stick with kubernetes==31.0.0 and wait for the fix to be release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants