I’m building an App that runs on K8s version 1.21 and the container already includes Python 3.92. Do I still need to install https://github.com/kubernetes-client/python if I want to interact with Kubernetes using Python or am I good?
Thanks,
CodePudding user response:
Kubernetes Python client is the library that helps you interact with Kubernetes API.
So if you want to do anything with Kubernetes API from inside your Python program (e.g. query the currently running Pods), then you need to install Kubernetes python client.
However, if your application is just deployed in Kubernetes, but does not need interact with Kubernetes API, then you don't need it.
CodePudding user response:
Would like more info on what are planning to do. If you going to just run Python programs then you don't need this library at all. This is for accessing Kubernetes (K8S) REST APIs.Also even for REST API you can do normal REST API calls and handle Requests/Responses or take help from this library for doing the heavy lifting. Whether python is running outside or inside a container or pod, you need the library for accessing REST APIs to do specific API functionalities not related to actual python to work. Ref: https://kubernetes.io/docs/reference/using-api/client-libraries/