kustomize "must specify --enable-helm" for helmCharts in CI
The helmCharts field runs the Helm chart inflation generator, which is off by default because it shells out to helm. kustomize errors with "must specify --enable-helm" until you pass the flag (and have helm installed).
What this error means
kustomize build or kubectl apply -k fails with "Error: must specify --enable-helm" when the kustomization declares a helmCharts block.
Error: must specify --enable-helmCommon causes
The helm generator is disabled by default
Because it executes helm, kustomize requires an explicit opt-in flag to inflate charts declared in helmCharts.
helm is not installed on the runner
Even with the flag, chart inflation needs the helm binary; a runner without helm cannot inflate the chart.
How to fix it
Enable the helm generator
Pass --enable-helm on kustomize, or --enable-helm on kubectl, and ensure helm is installed.
kustomize build --enable-helm overlays/prod
# or with kubectl
kubectl apply -k overlays/prod --enable-helmInstall helm before the build
Inflation shells out to helm, so install it in a setup step.
- uses: azure/setup-helm@v4
with:
version: v3.15.0How to prevent it
- Pass --enable-helm wherever a kustomization uses helmCharts.
- Install helm on the runner alongside kustomize.
- Pin chart versions in helmCharts for reproducible inflation.