Customizing Helm Chart Output
Sometimes you must modify the output of a MATRIXX Helm chart, but there is no configuration property available for the change you want to make. Changes of this kind can be made with less potential cost using Helm post rendering. A post renderer takes the output of the Helm chart in YAML format from standard input (STDIN) and makes required changes before outputting to standard output (STDOUT).
The Kustomize post renderer can be run as included with kubectl or installed independently. (For information about running it from kubectl
, run
kubectl kustomize --help.) The Kustomize tool reads in the YAML from files in a directory. A simple script is required which bridges from STDIN to files.
Here is an example wrapper script which uses the kubectl kustomize command.
#!/bin/sh
# Save the STDIN as the chart output
cat <&0 > chartoutput.yaml
# Run the kustomize tool with kubectl
kubectl kustomize .
# Clean up
rm -rf chartoutput.yaml
Run the script with a command similar to the following:
helm install ag1 matrixx/matrixx -n matrixx --post-renderer ./kustomize-with-kubectl.sh