https://github.com/painless-software/kustomize-wrapper
Python wrapper that makes Kubernetes' kustomize more lovely
https://github.com/painless-software/kustomize-wrapper
kubernetes kubeval kustomize openshift
Last synced: 6 months ago
JSON representation
Python wrapper that makes Kubernetes' kustomize more lovely
- Host: GitHub
- URL: https://github.com/painless-software/kustomize-wrapper
- Owner: painless-software
- License: apache-2.0
- Created: 2020-01-19T23:36:43.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2023-11-01T14:49:30.000Z (over 2 years ago)
- Last Synced: 2025-10-27T03:25:12.127Z (8 months ago)
- Topics: kubernetes, kubeval, kustomize, openshift
- Language: Python
- Homepage: https://pypi.org/project/kustomize-wrapper
- Size: 42.5 MB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Kustomize Wrapper [](
https://pypi.org/project/kustomize-wrapper)
=================
[](
https://github.com/painless-software/kustomize-wrapper/actions/workflows/checks.yml)
[](
https://github.com/painless-software/kustomize-wrapper/actions/workflows/tests.yml)
[](
https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv5.2.1)
[](
https://github.com/instrumenta/kubeval/releases/v0.16.1)
[](
https://pypi.org/project/kustomize-wrapper)
[](
https://github.com/painless-software/kustomize-wrapper/blob/main/LICENSE)
A Python wrapper for the Kubernetes [Kustomize](https://kustomize.io/) 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
------------
```console
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:
```yaml
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:
```yaml
lint:
script:
- kustomize lint deployment/overlays/*
```
Instead of:
```yaml
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:
```yaml
production:
script:
- kustomize apply deployment/overlays/production --edit deployment/base \
set image IMAGE="foobar/application:${CI_COMMIT_SHA}"
```
Usage
-----
```console
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:
```ini
[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)
```console
tox -e kubernetes -- --fail-fast deployment/application/base
```