0
votes

I have a simple Helm chart that consists of a Deployment and a ConfigMap. The ConfigMap looks like this:

apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .Values.APP_NAMESPACE }}-config
data:
  LOGGED_OUT_MSG: "{{ .Values.LOGGED_OUT_MSG }}"

The ConfigMap is mounted as an envfrom in the Pod template:

...
envFrom:
  - configMapRef:
      name: {{ .Values.APP_NAMESPACE }}-config

For one of my non-production environments I have the file override.yaml:

# override.yaml
LOGGED_OUT_MSG: "You are logged out (DEV)"

I then do a Helm upgrade like this:

$ helm upgrade -f override.yaml mychart .

What I assumed would happen was that if I make a change to override.yaml and run the above helm upgrade command that Helm would notice that the value of LOGGED_OUT_MSG has changed and do a rolling restart of my Pods. However, that does not happen. Instead, I have to manually delete the Pods so that the change comes through.

Is there a way to run helm upgrade so that changes in override.yaml trigger Helm to do a rolling restart of the Pods?

1

1 Answers

1
votes

There is no way to do it by default AFAIK. You are looking for reloader by stakater. "Reloader can watch changes in ConfigMap and Secret and do rolling upgrades on Pods with their associated DeploymentConfigs, Deployments, Daemonsets and Statefulsets."

This will require installing the tool in your cluster and adding an annotation to your deployment.

https://github.com/stakater/Reloader