pulsar-helm-chart icon indicating copy to clipboard operation
pulsar-helm-chart copied to clipboard

superUserRoles order is unpredictable

Open arnarg opened this issue 3 years ago • 1 comments

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:

  1. Use following values:
broker:
  restartPodsOnConfigMapChange: true
auth:
  authentication:
    enabled: true
  superUsers:
    broker: "broker-admin"
    proxy: "proxy-admin"
    client: "admin"
  1. helm template a few times
  2. Notice the checksum/config annotation 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.

arnarg avatar Sep 15 '22 09:09 arnarg

Therefor it recommends also passing it through sortAlpha to sort the list alphabetically.

This seems like the right solution. @arnarg - are you interested in contributing this solution?

michaeljmarshall avatar Sep 18 '22 03:09 michaeljmarshall