k8s
k8s copied to clipboard
Implement support for configuring k8s via kubeconfig
hi, i am a newbie of k8s. and i were using kubectl recently until i saw this library
were there any method to read those config from kubectl from its configure file located at ~/.kube/config
because i am not familiar with kubectl's config format, so i dont know which of it refer to the cert file in your tutorials
Currently there is no option to read config from the config file, but we probably should have that.
For simple cases, it's fairly easy to find the fields you need. Iirc, you need the server
attribute from cluster
, and possibly the certificate-data
. You also need the username
and password
, or token
from user
. I don't recall exactly how it looks when using client certificates.
We are lacking some documentation on how to configure the library. You can have a look at many of the other repos under fiaas for examples. Most complete example is probably fiaas/fiaas-deploy-daemon.
Actually, I would like to keep this issue open, as a reminder that we need to look at the documentation, and possibly add some additional ways to configure the library.
This would be much easier if the python-base part of the official client was available as a dependency. I have opened an issue: https://github.com/kubernetes-client/python-base/issues/261