Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

painless-software/kustomize-wrapper

Repository files navigation

Kustomize Wrapper latest-version

checks-status tests-status kustomize kubeval python-support license

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

About

Python wrapper that makes Kubernetes' kustomize more lovely

Topics

Resources

License

Stars

Watchers

Forks

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /