Sign inSign up

mgoltzsche/kustomizr

By mgoltzsche

•Updated over 5 years ago

kpt function container image to run kustomize builds

Image
0

2.3K

mgoltzsche/kustomizr repository overview

⁠kustomizr

A kpt function⁠ container image to run kustomize builds.

It supports a declarative, idempotent build and deployment workflow with kpt⁠ and kustomize⁠.

⁠Usage example

The ./examples/hello-world example within this repository specifies a Kustomization⁠ and a function ConfigMap⁠ using the image mgoltzsche/kustomizr.

Render the kustomization into the output file ./examples/hello-world/deploy/generated.yaml that the function specifies (could be run each commit):

kpt fn run ./examples/hello-world

Note: If the kustomization accesses non-yaml files within its repository you may need to --mount its directory and specify an absolute path as the function's path parameter since non-yaml resources are not provided to the function via stdin.
Also a CI pipeline should ensure that the generate is always consistent with the source.

If needed kpt setters can be used to change kustomization values to e.g. deploy to a preview namespace:

kpt cfg set ./examples/hello-world namespace mypreviewns
kpt fn run ./examples/hello-world

Enable live deployments for the output directory (let kpt generate the inventory-template.yaml once with component UUID and namespace):

kpt live init ./examples/hello-world/deploy

Apply the rendered output that was written to the deploy sub directory previously (could be run in a CD pipeline):

kpt live apply ./examples/hello-world/deploy

⁠Development

Build the docker image:

make

Run a basic e2e test:

make test

Tag summary

Content type

Image

Digest

Size

16.9 MB

Last updated

over 5 years ago

docker pull mgoltzsche/kustomizr