How to get the kubeconfig from pinniped via Python? #1037
-
I install everything Pinniped-related in my K8s cluster via
Normally I would generate a kubeconfig file like
But I want to generate the kubeconfig file via Python. Hence, I started this Python code with
but I receive
Do you know how to make it possible to retrieve that via Python? :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @junoriosity,
Perhaps in your Python code you can exec the |
Beta Was this translation helpful? Give feedback.
-
Yes, the typical way would be to use If you wanted to create a single combined kubeconfig file for all of those clusters, you could merge the individual kubeconfig files into a single file using kubectl. See https://pinniped.dev/docs/tutorials/concierge-and-supervisor-demo/ for an example of doing that (search for "merge" within that doc). |
Beta Was this translation helpful? Give feedback.
Yes, the typical way would be to use
pinniped get kubeconfig
multiple times, once for each cluster. Each invocation can point to a different cluster by using--kubeconfig
and, if needed,--kubeconfig-context
, or using theKUBECONFIG
env var. These invocations will generate a new kubeconfig file per cluster.If you wanted to create a single combined kubeconfig file for all of those clusters, you could merge the individual kubeconfig files into a single file using kubectl. See https://pinniped.dev/docs/tutorials/concierge-and-supervisor-demo/ for an example of doing that (search for "merge" within that doc).