promscale icon indicating copy to clipboard operation
promscale copied to clipboard

Keys from Promscales connection secret are removed during helm upgrade

Open raphaelzoellner opened this issue 3 years ago • 1 comments

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_PASSWORD and PROMSCALE_DB_PASSWORD are 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.

raphaelzoellner avatar Jul 06 '22 12:07 raphaelzoellner

cc @timescale/o11y-services

VineethReddy02 avatar Jul 27 '22 07:07 VineethReddy02

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

paulfantom avatar Aug 18 '22 14:08 paulfantom