contrib-helm-chart
contrib-helm-chart copied to clipboard
chore(dependencies): add better support for fullnameOverride
Hi,
As far as I can tell, dependencies of the chart currently do not properly support fullnameOverride.
- Use proper host names (postgresql, redis)
Given the following values-local.yaml file, and helm install command helm install redash-euw3 . -f values.yaml -f values-local.yaml:
fullnameOverride: redash
redis:
fullnameOverride: redash-redis
postgresql:
fullnameOverride: redash-postgresql
The deployment environment variables will contain the wrong hosts for both redis and postgres:
REDASH_DATABASE_HOSTNAME: redash-euw3-postgresql
REDASH_REDIS_HOSTNAME: redash-euw3-redis-master
Since Helm 3.7 (released August 31, 2021) it's possible to invoke the subchart's named templates that we can use to match the service names. Those changes will not support postgres replication mode, nor redis sentinel, but I feel like those are not currently supported anyway.
- Use proper secret references (postgresql, redis)
Given the same values-local.yaml file, secret references will be wrong too. Templates are using the {{ include "redash.fullname" . }}- prefix which will not match any existing secret in case fullnameOverride is set for redash.
NAME READY STATUS RESTARTS AGE
redash-567487fc4b-zzprc 0/1 CreateContainerConfigError 0 2s
redash-adhocworker-6c587f47cb-fzd6h 0/1 CreateContainerConfigError 0 2s
redash-euw3-migrations-624js 0/1 CreateContainerConfigError 0 2s
redash-genericworker-648bddc87b-h5txc 0/1 CreateContainerConfigError 0 2s
redash-postgresql-0 0/1 ContainerCreating 0 2s
redash-redis-master-0 0/1 ContainerCreating 0 2s
redash-scheduledworker-cd959c959-b5q8s 0/1 CreateContainerConfigError 0 2s
redash-scheduler-7dcd4cbf46-2zjv6 0/1 CreateContainerConfigError 0 2s
The error will look like Warning Failed 4m28s (x12 over 6m38s) kubelet Error: secret "redash-euw3-postgresql" not found.
- Use fullnameOverride for the migration job (hook)
Finally, the migration job hook uses the {{ .Release.Name }}- prefix as a name instead of {{ include "redash.fullname" . }}-.
Those changes do not address any open issue. It's just a problem I ran into. What do you think of those changes ?
Thanks in advance for reviewing.