kayx23 opened a new issue, #997:
URL: https://github.com/apache/apisix-helm-chart/issues/997

   ## Problem
   
   The `apisix-ingress-controller` Helm chart 1.2.x renders three 
leader-election settings with camelCase names:
   
   ```yaml
   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:
   
   ```shell
   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](https://github.com/api7/api7-ingress-controller/issues/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
   
   - [Controller YAML 
tags](https://github.com/apache/apisix-ingress-controller/blob/2.1.0/internal/controller/config/types.go#L95-L105)
   - [Controller 
defaults](https://github.com/apache/apisix-ingress-controller/blob/2.1.0/internal/controller/config/config.go#L44-L80)
   - [Controller configuration 
loader](https://github.com/apache/apisix-ingress-controller/blob/2.1.0/internal/controller/config/config.go#L83-L119)
   - [Chart 
values](https://github.com/apache/apisix-helm-chart/blob/apisix-ingress-controller-1.2.1/charts/apisix-ingress-controller/values.yaml#L80-L109)
   - [Chart ConfigMap 
template](https://github.com/apache/apisix-helm-chart/blob/apisix-ingress-controller-1.2.1/charts/apisix-ingress-controller/templates/configmap.yaml#L23-L49)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to