Summary
charts/apisix-ingress-controller/templates/pdb.yaml calls helper templates that are not defined in _helpers.tpl.
When all of the following are true:
ingress-controller.enabled=true
ingress-controller.podDisruptionBudget.enabled=true
ingress-controller.deployment.replicas>1 (or autoscaling min replicas > 1)
helm template fails with a hard error.
This is easy to miss because in apisix 2.13.0, ingress-controller.enabled defaults to false.
Affected versions
| Chart |
Version |
apisix (parent) |
2.13.0 |
apisix-ingress-controller (dependency) |
1.1.1 |
Steps to reproduce
helm template myrelease apisix \
--repo https://apache.github.io/apisix-helm-chart \
--version 2.13.0 \
--set ingress-controller.enabled=true \
--set ingress-controller.podDisruptionBudget.enabled=true \
--set ingress-controller.deployment.replicas=2
Actual behavior
Error: apisix/charts/ingress-controller/templates/pdb.yaml:25:11
executing "apisix/charts/ingress-controller/templates/pdb.yaml" at <include "apisix-ingress-controller.fullname" .>:
error calling include:
template: no template "apisix-ingress-controller.fullname" associated with template "gotpl"
Expected behavior
A valid PodDisruptionBudget is rendered for the ingress-controller deployment.
Root cause
pdb.yaml references these helper names:
apisix-ingress-controller.fullname
apisix-ingress-controller.labels
apisix-ingress-controller.selectorLabels
But _helpers.tpl defines only:
apisix-ingress-controller-manager.name.fullname
apisix-ingress-controller-manager.labels
apisix-ingress-controller-manager.selectorLabels
So the three names used by pdb.yaml are undefined.
Suggested fix
In charts/apisix-ingress-controller/templates/pdb.yaml, replace:
| Current (broken) |
Correct |
apisix-ingress-controller.fullname |
apisix-ingress-controller-manager.name.fullname |
apisix-ingress-controller.labels |
apisix-ingress-controller-manager.labels |
apisix-ingress-controller.selectorLabels |
apisix-ingress-controller-manager.selectorLabels |
After these replacements, helm template succeeds and the PDB renders as expected.
Duplicate check
I checked existing issues in apache/apisix-helm-chart (open and closed) and did not find an issue for this exact helper-template mismatch / gotpl error.
Summary
charts/apisix-ingress-controller/templates/pdb.yamlcalls helper templates that are not defined in_helpers.tpl.When all of the following are true:
ingress-controller.enabled=trueingress-controller.podDisruptionBudget.enabled=trueingress-controller.deployment.replicas>1(or autoscaling min replicas > 1)helm templatefails with a hard error.This is easy to miss because in
apisix2.13.0,ingress-controller.enableddefaults tofalse.Affected versions
apisix(parent)2.13.0apisix-ingress-controller(dependency)1.1.1Steps to reproduce
Actual behavior
Expected behavior
A valid
PodDisruptionBudgetis rendered for the ingress-controller deployment.Root cause
pdb.yamlreferences these helper names:apisix-ingress-controller.fullnameapisix-ingress-controller.labelsapisix-ingress-controller.selectorLabelsBut
_helpers.tpldefines only:apisix-ingress-controller-manager.name.fullnameapisix-ingress-controller-manager.labelsapisix-ingress-controller-manager.selectorLabelsSo the three names used by
pdb.yamlare undefined.Suggested fix
In
charts/apisix-ingress-controller/templates/pdb.yaml, replace:apisix-ingress-controller.fullnameapisix-ingress-controller-manager.name.fullnameapisix-ingress-controller.labelsapisix-ingress-controller-manager.labelsapisix-ingress-controller.selectorLabelsapisix-ingress-controller-manager.selectorLabelsAfter these replacements,
helm templatesucceeds and the PDB renders as expected.Duplicate check
I checked existing issues in
apache/apisix-helm-chart(open and closed) and did not find an issue for this exact helper-template mismatch /gotplerror.