Kustomize for Kubernetes, but in Python
Project description
Build your Kubernetes manifests for Kustomize in Python!
Overview
The reason for this project to exist is to make it easier to create dynamic manifests to be exported for usage in Kubernetes’ “Kustomize” tool. And, by using Python and supporting the “dataclasses” language feature, it also helps reducing boilerplate by encouraging code reuse.
Kustomize, by itself, is already a very powerful tool, and it’s possible to deal with different apps and environments by using the “overlays” approach; but it’s not dynamic enough if you need to define manifests parameters through environment variables, for example. So this project aims to cover that gap.
A complement for Kustomize
This project is by no means a replacement for Kustomize, but rather a complement. The idea is to generate kustomization files from Python files, and then use kubectl apply -k or kustomize build to transform them into final manifests for Kubernetes (even applying them to the cluster).
In other words, the idea is to “compile” Python files into Kustomize files, then just use Kustomize for the rest of the deployment.
Installing
This package will be available as kustomize; you may install it with pip, for example:
$ pip install kustomize
Usage
The summary is:
You write a source directory with Python files representing the Kustomize files (see directories at python-kustomize/tests/fixtures/);
You run:
$ pykustomize <source-dir> <dest-dir>
where <dest-dir> will be the directory where Kustomize YAML files will be put at;
Then you can apply the generated Kustomize files into your cluster:
$ kubectl apply -f <dest-dir>
and done!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file kustomize-0.1.0.tar.gz
.
File metadata
- Download URL: kustomize-0.1.0.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb309a4ba5d5a8514843acf8b9578807036630ab7cc85976fec6d62ae6705404 |
|
MD5 | f57a8644ceee8af42ce11a48b89729cc |
|
BLAKE2b-256 | 5c918de9e1d0e766f672bf69f3e6d0352137beeb20d62709ecc344e298ed508d |
File details
Details for the file kustomize-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: kustomize-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 24.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f65a6301a3d96d484571a6f0f0cf09c0cd97806436c8ad81b95257f16b230cbb |
|
MD5 | c8173e40da87b4aca74c4858f45e9831 |
|
BLAKE2b-256 | b6cbb2c0e9223d40a1558cc5d682b3ca718b49aa0ff8a3af0901702916fb7e0d |