May 2018
Intermediate to advanced
554 pages
13h 51m
English
An even more programmatic way to utilize Kubernetes API is to use the client library (https://kubernetes.io/docs/reference/client-libraries/). Making good use of these client tools not only saves you time in resource management, but also produce a robust and reliable CI/CD environment. Here, we would like to introduce the Kubernetes client library for Python: https://github.com/kubernetes-client/python. To start, you should install the Python library for Kubernetes:
$ pip install kubernetes
Then, please put the following Python file at the same location as the JSON configuration file, nginx-deployment.json, where firing kubectl does work on the system:
$ cat create_deployment.pyfrom kubernetes import client, configimport json ...
Read now
Unlock full access