This is an adaption of the Kustomize ReplacementTransformer plugin to the config function interface. It is based on the kubeval validation function.
The function is implemented as an image, and built using make image
.
The function is implemented as a go program, which a configuration of
replacement sources and targets, and applies them to the other YAML
documents that are processed. The config file ReplacementTransformer
syntax,
but is annotated with a config.kubernetes.io/function
container image.
A number of settings can be modified for kubeval
in the function spec
. See
the API
struct definition in main.go for documentation.
The function is invoked by authoring a local Resource
with a metadata annotation of config.kubernetes.io/function
:
kustomize config run local-resource/
Please note that this modifies the local-resource documents in line; this can
be avoided by piping the output of the command when using the --dry-run
flag.
Run the validator with:
kustomize config run local-resource/ --dry-run
This will return the input documents, with a single replacement applied
against the Service's spec.environmentLabel
.