-
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
Examples show off load_kube_config()
as the Right Way to set up the module, but an attempt at load_incluster_config()
is also required to match the behavior of kubectl and work form inside pods
#1005
Comments
/assign @fabianvf |
Some documentation of the Right Way to get the "current" namespace would also be helpful here; the way that works when using config files ( |
Frankly, all of this would be much simpler with a single |
Yeah, I think a general |
This is also related to #741 in that, having loaded the config, credentials which expire aren't refreshed in the background. So the Right Way to get credentials ought to include some kind of periodic refresh, or at least a note that you need it. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Most of the examples still ignore /remove-lifecycle stale |
client-go has a function that does "try and fallback". We should have a method mimics its behavior |
I would like to work on this issue. /assign @iamneha |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
The Python examples still don't note the need for /remove-lifecycle stale |
Hey @iamneha |
Looks like this isn't being actively worked on. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
try to load KUBECONFIG first and eventually failback to incluster config only if the first failed to mimic kubectl behaviour See: kubernetes-client/python#1005 Signed-off-by: Simone Tiraboschi <[email protected]>
try to load KUBECONFIG first and eventually failback to incluster config only if the first failed to mimic kubectl behaviour See: kubernetes-client/python#1005 Signed-off-by: Simone Tiraboschi <[email protected]>
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closing this issue. In response to this:
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/test-infra repository. |
The KubernetesProvider now falls back to loading config in-cluster if a kube-config file is not found. This allows in-cluster submission of parsl jobs. See kubernetes-client/python#1005 for a good description of the issue. Co-authored-by: T. Andrew Manning <[email protected]> Co-authored-by: Matt Fisher <[email protected]> Co-authored-by: Ben Clifford <[email protected]>
The current setup for the plugin assumes that we have a kubeconfig file used to connect to the cluster. However, this is not the case if the code submitting the job is itself running in a pod in the cluster, as we will need to use the default service account provided by the cluster. This modifies the init to catch any errors when loading a kubeconfig file and use the incluster configuration instead The issue in the python kubernetes client here describes the problem: kubernetes-client/python#1005
Link to the issue (please include a link to the specific documentation or example):
See the examples in the README:
https://github.com/kubernetes-client/python#examples
Description of the issue (please include outputs or screenshots if possible):
The examples of how to set up the module all (except for
in_cluster_config.py
) look like this:This gives the impression that this is all you need to do to pick up "the" Kubernetes configuration that your user is going to expect you to use (i.e. whatever
kubectl
would use). However, this is not the case.If you are running in a pod, and you want to use the configuration that
kubectl
picks up (for the pod's service account, talking to the current Kubertnetes), you need to runconfig.load_incluster_config()
if/whenconfig.load_kube_config()
fails. Since, outside of very specialized situations, you don't really know where your user's will run your software or which method will produce the actual Kubernetes credentials in advance, the Right Way to connect to Kubernetes is not a single method call but a try/except, something like this:The examples in the README, and possibly in the examples folder, should be changed to demonstrate credential loading that works like
kubectl
and pulls from either of these sources as available.Ideally, the two utility methods should be merged/wrapped in a utility method that loads whichever config is available.
It looks like a similar proposal (with the order reversed) was made as part of #487, but that was part of a larger request, and it was killed by the stale bot without anyone actually solving this particular problem.
The text was updated successfully, but these errors were encountered: