Skip to content

fix(ingress-controller): render valid leader-election keys and align config defaults #997

Description

@kayx23

Problem

The apisix-ingress-controller Helm chart 1.2.x renders three leader-election settings with camelCase names:

leader_election:
  leaseDuration: 15s
  renewDeadline: 10s
  retryPeriod: 2s

APISIX Ingress Controller 2.1.0 accepts the YAML keys lease_duration, renew_deadline, and retry_period. Its configuration loader uses non-strict yaml.Unmarshal, so the rendered camelCase keys are silently ignored.

As a result:

  • The chart's default 15s lease duration is not applied; the binary default 30s remains effective.
  • The chart's default 10s renewal deadline is not applied; the binary default 20s remains effective.
  • User overrides of .Values.config.leaderElection.leaseDuration, renewDeadline, and retryPeriod do not affect controller behavior.

Reproduction

Render the default ConfigMap:

helm template test apisix/apisix-ingress-controller \
  --show-only templates/configmap.yaml

The rendered config.yaml contains camelCase leader-election keys. Starting controller 2.1.0 with that configuration leaves the prefilled NewLeaderElection() defaults unchanged because those keys do not match the binary's explicit YAML tags.

Related default drift

The same chart surface contains additional defaults that should be reconciled with the controller or explicitly documented as intentional:

Field Controller 2.1.0 Chart values.yaml Template fallback
leader_election_id apisix-ingress-gateway-leader apisix-ingress-controller-leader apisix-ingress-controller-leader
provider.sync_period 1h 1m 1s
server_addr :9092 Not exposed Not rendered
enable_server false Not exposed Not rendered

The template fallback for sync_period is a hidden third value that is used when the Helm value is absent or empty.

The cross-product API7/APISIX comparison and default-alignment decisions are tracked in api7/api7-ingress-controller#462. This issue is limited to the upstream APISIX chart and controller contract.

Expected behavior

  • The chart should render configuration keys accepted by the controller.
  • Every documented Helm override should change the effective controller configuration.
  • values.yaml, template fallbacks, and controller defaults should agree unless a chart-specific override is intentional and documented.

Proposed acceptance criteria

  • Render leader-election keys as lease_duration, renew_deadline, and retry_period.
  • Verify that setting each config.leaderElection.* value changes the loaded controller configuration.
  • Reconcile the provider.syncPeriod value and template fallback with the controller default, or document why the Helm-installed behavior intentionally differs.
  • Decide whether the chart should preserve its leader_election_id override; include upgrade guidance if it changes.
  • Decide whether enableServer and serverAddr should be exposed consistently.
  • Add a test that renders the chart and loads the resulting config.yaml through the controller parser so unknown or ineffective keys are detected.

Evidence

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions