Description
When configuring APISIX to bind to IPv6 addresses using [::] in values.yaml, the generated ConfigMap contains unquoted values which causes YAML parsing errors in APISIX.
Environment
- Helm Chart Version: 2.12.4
- Kubernetes Version: 1.34
- Helm Version: 3.18.4 (Through terraform's helm provider)
Steps to Reproduce
- Set in values.yaml:
apisix:
admin:
ip: "[::]"
allow:
ipList:
- "::/0"
- Deploy the chart:
helm install apisix apisix/apisix -f values.yaml
- Check APISIX pod logs or ConfigMap
- Observe YAML parsing error
Expected Behavior
IPv6 addresses should be properly quoted in the generated ConfigMap:
ip: "[::]"
admin:
allow_admin:
- "::/0"
Actual Behavior
ConfigMap contains unquoted values that fail YAML parsing:
ip: [::] # Invalid YAML - interpreted as flow sequence
admin:
allow_admin:
- ::/0
Root Cause
The ConfigMap template does not force quotation of IP addresses in listeners or the admin allow list. YAML interprets [ as the start of a flow sequence, making [::] invalid syntax without quotes.
Examples from the template:
ip: {{ .Values.apisix.admin.ip }}
{{- range $ips := .Values.apisix.admin.allow.ipList }}
- {{ $ips }}
{{- end }}
Current Workaround
Manually add escaped quotes in values.yaml:
apisix:
admin:
ip: "\"[::]\""
allow:
ipList:
- "\"::/0\""
Or use the --set-string flag:
helm install apisix apisix/apisix --set-string apisix.admin.ip='[::]'
Proposed Solution
Wrap relevant configmap sections such as IP address template values with quotes:
ip: {{ .Values.apisix.admin.ip | quote }}
{{- range $ips := .Values.apisix.admin.allow.ipList }}
- {{ $ips | quote }}
{{- end }}
I'm happy to submit a PR for this fix if helpful. This may be combined with my other issue (#921) which also touches the ConfigMap template file.
Note: AI helped format this issue. The issue identification and proposed solutions are my own work.
Description
When configuring APISIX to bind to IPv6 addresses using
[::]in values.yaml, the generated ConfigMap contains unquoted values which causes YAML parsing errors in APISIX.Environment
Steps to Reproduce
helm install apisix apisix/apisix -f values.yamlExpected Behavior
IPv6 addresses should be properly quoted in the generated ConfigMap:
Actual Behavior
ConfigMap contains unquoted values that fail YAML parsing:
Root Cause
The ConfigMap template does not force quotation of IP addresses in listeners or the admin allow list. YAML interprets
[as the start of a flow sequence, making[::]invalid syntax without quotes.Examples from the template:
Current Workaround
Manually add escaped quotes in values.yaml:
Or use the
--set-stringflag:helm install apisix apisix/apisix --set-string apisix.admin.ip='[::]'Proposed Solution
Wrap relevant configmap sections such as IP address template values with quotes:
I'm happy to submit a PR for this fix if helpful. This may be combined with my other issue (#921) which also touches the ConfigMap template file.
Note: AI helped format this issue. The issue identification and proposed solutions are my own work.