promscale
promscale copied to clipboard
Keys from Promscales connection secret are removed during helm upgrade
Currently the following lines in Promscales helm chart have negative side effects for helm upgrades: https://github.com/timescale/promscale/blob/master/deploy/helm-chart/templates/secret-connection.yaml#L33-L44
{{- /*
During upgrades we want to preserve password and user set from other sources.
This is done in `data` field as Secrets are base64 encoded and it is easier to not decode them and place in `stringData` field.
*/}}
{{- if .Release.IsUpgrade }}
data:
{{- if eq (.Values.connection.password | toString) "" }}
PROMSCALE_DB_PASSWORD: {{ index (lookup "v1" "Secret" .Release.Namespace (include "promscale.fullname" .) ).data "PROMSCALE_DB_PASSWORD" }}
{{- end }}
{{- if eq (.Values.connection.user | toString) "" }}
PROMSCALE_DB_USER: {{ index (lookup "v1" "Secret" .Release.Namespace (include "promscale.fullname" .) ).data "PROMSCALE_DB_USER" }}
{{- end }}
{{- end }}
Effects:
- secret values for the keys
PROMSCALE_DB_PASSWORDandPROMSCALE_DB_PASSWORDare not being updated. - other keys and values are removed during the helm upgrade (e.g.
PROMSCALE_DB_URI).
I suggest to remove the lines and instead make use of the already added connectionSecretName in case a secret is provided by another source than this helm chart.
cc @timescale/o11y-services
We've moved the helm chart to the other repository and simplified the Secret update procedure while changing it in tobs. Now it is easier (it is the same what you proposed) and should be working. You can use it by using promscale helm chart version 13.0.0