Sometimes when I use helm charts, not all things I want to modify are usable with the given values. Is it practical to use kustomize to modify the rendered helm chart?
So like this:
chart -> helm template -> kustomize -> kubectl deploy
Asked
Active
Viewed 3,272 times
5

8bit
- 528
- 2
- 6
- 25
-
This is an opinionated question. But I would recommend `kustomize`, it is a newer tool and it is closer to Kubernetes config management vision. – Jonas Jul 01 '21 at 19:44
-
The Kustomize Background white paper is a good read, it also compares to Helm: https://github.com/kubernetes/community/blob/master/contributors/design-proposals/architecture/declarative-application-management.md – Jonas Jul 01 '21 at 19:46
-
Yes, doing kustomize over result of helm template is a common pattern - Google for kustomize over helm. – taleodor Jul 01 '21 at 23:10
-
The whitepaper that @Jonas linked to has since been moved here: https://github.com/kubernetes/design-proposals-archive/blob/main/architecture/declarative-application-management.md – paul Jan 12 '22 at 13:57
-
1From Helm 3.1+ onwards we can use helm's post rendering mechanism to call tools like kustomize https://helm.sh/docs/topics/advanced/#post-rendering – Kiran P Aug 20 '22 at 11:50
1 Answers
11
We do use it sometimes. You can use Helm directly in Kustomize with the helmCharts plugin. In my example, values-prod.yaml
has to be in the same directory as the kustomization.yaml
. namespace: custom-metallb
will override namespace: metallb
for example.
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: custom-metallb
helmCharts:
- name: metallb
namespace: metallb
releasename: metallb
repo: https://metallb.github.io/metallb
version: 0.10.2
ValuesFile: values-prod.yaml
To be honest, the documentation is not that great, but you can find the arguments here: https://github.com/kubernetes-sigs/kustomize/blob/master/api/types/helmchartargs.go
Documentation from kustomize: https://github.com/kubernetes-sigs/kustomize/blob/master/examples/chart.md

CLNRMN
- 1,409
- 9
- 23