A wrapper for Kustomize and related tooling.
Project description
Kustomize Wrapper
A Python wrapper for the Kubernetes Kustomize tool and related tooling.
- More readable, more concise one-liners
- Easy linting (with integrated
kubeval
) - Integrates into your Python tooling (e.g. use it with
tox
) - Automatic download of external Go binaries
- Cross-platform (installs matching Go binaries on Linux, macOS, Windows)
Installation
python3 -m pip install kustomize-wrapper
Why should I use this tool?
Forget about several kustomize
calls, piping your calls into kubeval
or kubectl apply
commands. Using Kustomize is now even more pleasant!
Instead of:
lint:
script:
- kustomize build deployment/overlays/development | kubeval --strict
- kustomize build deployment/overlays/integration | kubeval --strict
- kustomize build deployment/overlays/production | kubeval --strict
You can now write:
lint:
script:
- kustomize lint deployment/overlays/*
Instead of:
production:
script:
- cd deployment/base
- kustomize edit set image IMAGE="foobar/application:${CI_COMMIT_SHA}"
- cd ../..
- kustomize build deployment/overlays/production | kubectl apply -f -
You can now write:
production:
script:
- kustomize apply deployment/overlays/production --edit deployment/base \
set image IMAGE="foobar/application:${CI_COMMIT_SHA}"
Usage
kustomize --help
Philosophy:
- Build automatically
- Kustomize commands become CLI options
- Kubeval options become CLI options of
lint
command
Python tox
Add kustomize-wrapper to your tox.ini
, then Tox takes care of downloading:
[testenv:kubernetes]
description = Validate Kubernetes manifests
deps = kustomize-wrapper
commands =
kustomize lint {posargs:--ignore-missing-schemas --fail-fast \
deployment/application/overlays/development \
deployment/application/overlays/integration \
deployment/application/overlays/production \
}
Allows you to override arguments: (Use --
in case you add command line options)
tox -e kubernetes -- --fail-fast deployment/application/base
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
kustomize-wrapper-0.15.0.tar.gz
(12.9 kB
view details)
Built Distribution
File details
Details for the file kustomize-wrapper-0.15.0.tar.gz
.
File metadata
- Download URL: kustomize-wrapper-0.15.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5115a90cd1c279164b33ab74265744c5b5ce678ef293f6f961a7b4274d2e6c9d |
|
MD5 | c28c23ed4a0d82de20ae7ef3f3d9bd12 |
|
BLAKE2b-256 | 2c657f80caaa720f4776ad05a0e98bf98bb48ec13cd636ad8e042c37343b66a6 |
File details
Details for the file kustomize_wrapper-0.15.0-py3-none-any.whl
.
File metadata
- Download URL: kustomize_wrapper-0.15.0-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78b29fc92882197ba7568661ec81480711693b373de5816c393cb2398ae2e948 |
|
MD5 | a0b558bb6a8d73ea0e66506b7f1f2a2d |
|
BLAKE2b-256 | 36ce3a0f247353406635f59bfe5017d63fdc3e17096b564eca5cb0e171fee123 |