Closed MyMirelHub closed 3 years ago
Hi, I have the same error but it only fails in kong-kong-pre-upgrade-migrations
job
time="2021-05-10T14:10:30Z" level=info msg="spawning process: [/bin/sh -c kong migrations up]"
Error: headers: invalid entry 'false'
Run with --v (verbose) or --vv (debug) for more details
Config:
...
env:
headers: off
...
Thanks!
Yeah, YAML's helpful boolean aliases often aren't that helpful, unfortunately. You'll just need to quote it:
$ cat /tmp/headers.yaml
env:
headers: off
$ cat /tmp/headers_quotes.yaml
env:
headers: "off"
$ helm template ex kong/kong -f /tmp/headers.yaml | grep -A1 KONG_HEADE
- name: KONG_HEADERS
value: "false"
$ helm template ex kong/kong -f /tmp/headers_quotes.yaml | grep -A1 KONG_HEADE
- name: KONG_HEADERS
value: "off"
off
/false
are equivalent in most kong.conf settings, but headers
is handled a bit differently because Kong doesn't actually store it as a boolean--it's a string instead to handle the other possible settings (e.g. server_tokens
). The usual rule doesn't work for it as such.
Problem Setting an environment variable field to
off
in the helm chart, gets translated tofalse
which is breaking the deployment.What I expect to happen According to the configuration docs, boolean values of both
off
andfalse
should be accepted and not beak the config.Steps to reproduce
In the chart
values.yaml
I am setting theHEADERS
field fromhttps://github.com/Kong/kong/blob/master/kong.conf.default
tooff
The chart then translates this to
false
in the deployment which sends the pod in a crash loopkubectl get pods
Additional details
Editing the deployment yaml in k8s directly
kubectl edit kong.yaml
and setting it tooff
fixes it.Kong chart version 2.1.0, Kong app version 2.4