superUserRoles order is unpredictable
Describe the bug
When specifying multiple roles in .Values.auth.superUsers the values are converted to a comma-separated list by piping the dict through values and join in helm templating, values however doesn't guarantee that the order of elements will be the same every time. Therefor it recommends also passing it through sortAlpha to sort the list alphabetically.
This is a problematic when .Values.broker.restartPodsOnConfigMapChange is enabled because the checksum of the configmap changes every time the list's order is changed, resulting in the statefulsets rolling out a new version of the pods.
Relevant code: https://github.com/apache/pulsar-helm-chart/blob/c059ea25d80d6165b67ee163252a682198d8933f/charts/pulsar/templates/broker-configmap.yaml#L113 https://github.com/apache/pulsar-helm-chart/blob/c059ea25d80d6165b67ee163252a682198d8933f/charts/pulsar/templates/proxy-configmap.yaml#L68
To Reproduce Steps to reproduce the behavior:
- Use following values:
broker:
restartPodsOnConfigMapChange: true
auth:
authentication:
enabled: true
superUsers:
broker: "broker-admin"
proxy: "proxy-admin"
client: "admin"
helm templatea few times- Notice the
checksum/configannotation in broker statefulset change often without any change to values.yaml.
Expected behavior No changes to the templated output to happen when no values changes happen.
Additional context We use ArgoCD to automatically sync our pulsar application every 10 minutes which is causing the pods to restart almost every time.
Therefor it recommends also passing it through
sortAlphato sort the list alphabetically.
This seems like the right solution. @arnarg - are you interested in contributing this solution?