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.16.0.tar.gz
(21.4 kB
view details)
Built Distribution
File details
Details for the file kustomize-wrapper-0.16.0.tar.gz
.
File metadata
- Download URL: kustomize-wrapper-0.16.0.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4fc8551a4dc89540e065e27e9524af78c894d4e7e1c1a02f5809f99ec941a07 |
|
MD5 | ebf29e3e1c03d0a816fef9fc37a0e43d |
|
BLAKE2b-256 | bf2085cbd7e8ec66c79a3a2b3b5ded74385c32a7d9fd0a0c85a70511d7c286ad |
Provenance
File details
Details for the file kustomize_wrapper-0.16.0-py3-none-any.whl
.
File metadata
- Download URL: kustomize_wrapper-0.16.0-py3-none-any.whl
- Upload date:
- Size: 18.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a735d7b936149e26c6e1adeb4b7456b4cbffa31dc02571f8d6c4332b3a579e41 |
|
MD5 | dbe374926da369b1831b9c6857e111a6 |
|
BLAKE2b-256 | 9890b01e2133257f0930b14cd7260afc7eac8d39f7cd4878e0b4936c74e236bb |