This is a collection of KRM functions that can be used in Kustomize projects to extend Kustomize builtin features
- replacement extra: the kustomize builtin replacement with extra features: regex support
- password generator: inject random data in your secrets: password, ssh key pair, uuid
The following shows how to integrate replacement-extra in a kustomization file. More examples are available in the Kustomize project repository
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- resources.yaml
transformers:
- transformer.yaml
Functions can be configured using a docker image or an executable file
apiVersion: kustomize-functions.zprd.io/v1
kind: ReplacementExtra
metadata:
name: replacementServiceUrl
annotations:
config.kubernetes.io/function: |-
container:
image: ghcr.io/sda399/kustomize-functions/replacement-extra:v1.0.0
replacements:
...
curl "$URL/replacement-extra" -o /opt/krm-functions/replacement-extra
export PATH=$PATH:/opt/krm-functions
apiVersion: kustomize-functions.zprd.io/v1
kind: ReplacementExtra
metadata:
name: replacementServiceUrl
annotations:
config.kubernetes.io/function: |-
exec:
path: replacement-extra
replacements:
...
build when invoking a docker image:
kustomize build --enable-alpha-plugins ./
alternatively when using a executable file:
kustomize build --enable-alpha-plugins --enable-exec ./