Skip to main content

A wrapper for Kustomize and related tooling.

Project description

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

Project details


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.12.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

kustomize_wrapper-0.12.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file kustomize-wrapper-0.12.0.tar.gz.

File metadata

  • Download URL: kustomize-wrapper-0.12.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for kustomize-wrapper-0.12.0.tar.gz
Algorithm Hash digest
SHA256 770d9f9c23ba952829aab07a49036d2dc2f49dea517b1c31bb36f676ef1c4733
MD5 b486b30af200ebb659ccfaca35d583a1
BLAKE2b-256 2edaf0a4ef48fac994b938c83062af9985527c24e3ef895f11a0ffc1e1b67a56

See more details on using hashes here.

File details

Details for the file kustomize_wrapper-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: kustomize_wrapper-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for kustomize_wrapper-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ae158fd06b132e6294574dce386f83479276633c8fb0bcd8cc415167f1c6730
MD5 4d4a561cceba86794ce422cb8a8329e3
BLAKE2b-256 cdfa80820b1c2b6fe8c9fd920d1acfed4d2a8d70081c8c510b577d8115ee453a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page