python icon indicating copy to clipboard operation
python copied to clipboard

kubernetes.client.Configuration.set_default is not working as expected

Open DARSHAN-THE-CODER opened this issue 1 year ago • 5 comments

What happened (please include outputs or screenshots): configuraa = client.Configuration() configuraa.retries = 1 client.Configuration.set_default(configuraa) Here, I am trying to override retries value from 3 to 1. This is from the source code -> Screenshot 2024-03-01 at 12 30 58 AM

But I found that , you are not receiving that parameter here -> Screenshot 2024-03-01 at 12 32 19 AM

What you expected to happen: Expected behaviour -> User should be able to override max retry times incase cluster is not reachable How to reproduce it (as minimally and precisely as possible): Try to reach any cluster which doesnt exist properly from the above code Anything else we need to know?: After a long time, this error is printed , Which takes literally a lot of time ! and get this error message Screenshot 2024-03-01 at 12 46 08 AM

Environment:

  • Kubernetes version (kubectl version) : Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.14") , Server Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.9-gke.1092000"
  • OS (e.g., MacOS 10.13.6): linux/amd64
  • Python version (python --version) : Python 3.6.8
  • Python client version (pip list | grep kubernetes): kubernetes 26.1.0

DARSHAN-THE-CODER avatar Feb 29 '24 19:02 DARSHAN-THE-CODER

Hi, here rest.py is the right code receiving the parameter retries.

showjason avatar Mar 02 '24 15:03 showjason

/assign @showjason

roycaihw avatar Mar 13 '24 20:03 roycaihw

Hi, here rest.py is the right code receiving the parameter retries.

It is not working, as in even retries is not getting applied

DARSHAN-THE-CODER avatar Mar 14 '24 13:03 DARSHAN-THE-CODER

Hi, here rest.py is the right code receiving the parameter retries.

It is not working, as in even retries is not getting applied

please try the following code:

from kubernetes import client, config

conf = client.Configuration()
conf.retries = 3
config.load_kube_config(client_configuration=conf)
client.Configuration.set_default(conf)

v1 = client.CoreV1Api()

resp = v1.read_namespaced_pod("<pod_name>", "<namespace>")
print(resp)

showjason avatar Mar 15 '24 15:03 showjason

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jun 13 '24 16:06 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Jul 13 '24 16:07 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Aug 12 '24 17:08 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

k8s-ci-robot avatar Aug 12 '24 17:08 k8s-ci-robot