Python: [help] How to access api server via python client in pod

Created on 20 Sep 2018  路  2Comments  路  Source: kubernetes-client/python

Hi,

I need to run the python client in the pod to access api server. When the python client runs in the pod, it raise an error that

No such file or directory: '/root/.kube/config'

It seems that the python client tries to read config file. Is there any approach to configure the client in the pod?

thanks a lot.

Most helpful comment

You have to use a different method to configure client. Here is an example: https://github.com/kubernetes-client/python/blob/master/examples/in_cluster_config.py#L55

All 2 comments

You have to use a different method to configure client. Here is an example: https://github.com/kubernetes-client/python/blob/master/examples/in_cluster_config.py#L55

@tomplus Thanks a lot.

Was this page helpful?
0 / 5 - 0 ratings