kustomize

command
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

README

Kustomize Plugin (experimental)

Kustomize currently supports two kinds of plugins: exec and go.

Unfortunately, it's not possible to run kfilt as a Kustomize exec plugin. An exec plugin works by emitting resources on stdout and the framework merges those into the resources generated by Kustomize. As far as I can tell, there is no way to tell Kustomize to remove resources in an exec plugin. It is possible to run kfilt as a go plugin since it will have access to the full Kustomize API.

However, go plugins are extremely brittle and hard to distribute. Effectively, an end user of the plugin must compile both the plugin and Kustomize itself.

This directory contains an experimental kfilt Kustomize plugin packaged into a Docker image.

Build the Image

You can use make to build the Docker image that contains both the Kustomize binary and the kfilt plugin.

make REGISTRY=gcr.io/my-project

You should specify a valid Docker Hub, GCR, or other Docker registry url for the value of the REGISTRY variable.

Run the Image

The make run target will run a container from the image against the example Kustomize base. This simple example excludes Secrets from a remote Kustomize base.

make run

Future

It is questionable as to how much value there is for a kfilt Kustomize plugin. Excluding resources from Kustomize bases should generally be avoided. When you do need to do it, you can either use a delete strategic merge patch or you can just compose kfilt into your pipeline:

kustomize build | kfilt -K Secret | kubectl apply -f -

No plugins required.

If you have thoughts about this, please file an issue for further discussion.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL