Hey everyone,
I'm running into a frustrating issue while trying to deploy a Renovate cron job using a Helm chart in Flux. Specifically, the environment variables in my values file aren't being set up correctly, and it's driving me a bit crazy. Here's what my values file looks like:
env:
- name: LOG_LEVEL
value: "DEBUG"
- name: RENOVATE_TOKEN
valueFrom:
secretKeyRef:
name: github
key: RENOVATE_TOKEN
When I check the container output YAML, I see the following:
spec:
containers:
- env:
- name: "0"
value: map[name:LOG_LEVEL value:DEBUG]
I've double-checked the indentation and compared it to another values file where the environment variables are working fine, but I can't seem to spot the difference. This is also related to an issue I'm having with authentication to GitHub failing.
I'd really appreciate any pointers to help figure this out!
Oh, and I've updated my original post with the full HelmRelease and other configuration files if that helps! Thanks in advance for your responses!
2 Answers
It seems like an indentation issue—YAML is super sensitive to space. You should make sure that ‘env’ is strictly aligned with ‘containers’. Sometimes a small space can throw everything off!
It looks like the Helm template might not be set up well. The way it renders might be causing issues. Check this snippet:
{{- range $k, $v := .Values.env }}
- name: {{ $k | quote }}
value: {{ $v | quote }}
{{- end }}
Alternatively, using envList could streamline your setup:
{{- with .Values.envList }}
{{- toYaml . | nindent 16 }}
{{- end }}
Thanks for this tip! I was so focused on my values files that I didn’t think to check the Helm template itself. This has really helped get LOG_LEVEL sorted out!
Check out this line in the Helm chart if you want to see how it’s structured: https://github.com/renovatebot/helm-charts/blob/main/charts/renovate/templates/cronjob.yaml#L172

That’s exactly what I thought too! But I can’t seem to find where I went wrong either.