Skip to content

Bug: pdb.yaml references undefined template helpers in apisix-ingress-controller (fails when HA is enabled) #946

@johannes-engler-mw

Description

@johannes-engler-mw

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions