Davanum Srinivas c1d099e7f2 TLS integration for latest pythonk8sclient
swagger_client uses PoolManager from urllib3. PoolManager keeps the
connection_pool_kw passed during the init time and uses the same later
while initiating HTTPSConnection. Existing implementation instantiates
RESTClientObject() at import time, without giving an option to pass
the security parameters, viz. key_file, ca_certs etc. So we needed to
change the way instantiation/initialization was happening.

(copied from I3b490bbb47eb5f961951708dabe6c1abfbcece4e)

Change-Id: I6df227bcd030cb8c374bc83bb44dfea980c893b3
2016-04-22 14:41:31 -04:00
2016-04-01 14:27:35 -04:00
2016-04-19 17:16:25 +02:00
2016-04-01 14:27:35 -04:00
2016-04-01 17:26:32 -04:00
2016-04-02 20:59:30 -04:00

python-k8sclient - Kubernetes API client code

Overview

This is Kubernetes API python client code. This code is generated by swagger-codegen. Kubernetes provide swagger-spec to generate client code for different versions. The specs live in Kubernetes repo.

See also

Prerequisites

You need to install required packages for swagger codegen. Please refer to https://github.com/swagger-api/swagger-codegen#prerequisites

Steps to generate API client code

Steps to generate Kubernetes client code for v1:

  • Clone the Magnum repo:

    git clone https://github.com/openstack/python-k8sclient.git
* Clone the swagger-codegen repo. It is recommended to checkout a release

(e.g. v2.1.3) instead of using the master branch:

git clone https://github.com/swagger-api/swagger-codegen.git
cd swagger-codegen/
git checkout tags/v2.1.3
  • Build swagger-codegen:

    mvn package
  • Update the v1.json from latest Kubernetes release:: curl -o ./k8sclient/templates/v1.json https://raw.githubusercontent.com/kubernetes/kubernetes/v1.2.2/api/swagger-spec/v1.json

  • Run below command to generate the API client code for Kubernetes:

    cd ..
    java -jar ./swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar \
        generate \
        -i ./k8sclient/templates/v1.json \
        -l python -o ./KubernetesClientCode

Now you can check the code at location ./KubernetesClientCode.

Description
Python API for Kubernetes
Readme 627 KiB
Languages
Python 99.9%
Shell 0.1%