Skip to content

mgoltzsche/kustomizr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kustomizr GitHub workflow badge

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