Skip to content

sda399/kustomize-functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KRM functions aka Kustomize functions

This is a collection of KRM functions that can be used in Kustomize projects to extend Kustomize builtin features

List of available functions

Usage example

The following shows how to integrate replacement-extra in a kustomization file. More examples are available in the Kustomize project repository

kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
  - resources.yaml

transformers:
  - transformer.yaml

transformer.yaml using a Docker image

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:
...

transformer.yaml as local executable file

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

build when invoking a docker image:

kustomize build --enable-alpha-plugins ./

alternatively when using a executable file:

kustomize build --enable-alpha-plugins --enable-exec ./

About

A Collection of KRM functions to extend Kustomize

Resources

Stars

Watchers

Forks

Packages