Skip to content

ClusterSource is immutable error #508

@gabschne

Description

@gabschne

I have a Redpanda cluster, which is set up using the operator in a Kubernetes env.

SASL auth is activated with SCRAM-SHA-512 as the mechanism.

I do use flux, therefore all topics, users and schemas are present as yaml files in a git repo, consumed and applied by the Flux kustomize operator.

I configured authentication for the mentions resources using a patch:

- target:
    kind: Topic|User|Schema
  patch: |-
    - op: add
      path: /spec/cluster
      value:
        staticConfiguration:
          kafka:
            brokers:
             - 'redpanda-0.redpanda.redpanda.svc.cluster.local:9093'
             - 'redpanda-1.redpanda.redpanda.svc.cluster.local:9093'
             - 'redpanda-2.redpanda.redpanda.svc.cluster.local:9093'
            tls:
              caCertSecretRef:
                name: 'redpanda-default-cert'
                key: 'ca.crt'
            sasl:
              username: admin
              passwordSecretRef:
                name: redpanda-admin-user
                key: password
              mechanism: 'SCRAM-SHA-512'
          admin:
            urls:
             - 'redpanda-0.redpanda.redpanda.svc.cluster.local:9644'
             - 'redpanda-1.redpanda.redpanda.svc.cluster.local:9644'
             - 'redpanda-2.redpanda.redpanda.svc.cluster.local:9644'
            tls:
              caCertSecretRef:
                name: 'redpanda-default-cert'
                key: 'ca.crt'
            sasl:
              username: admin
              passwordSecretRef:
                name: redpanda-admin-user
                key: password
              mechanism: 'SCRAM-SHA-512'
          schemaRegistry:
            urls:
             - 'redpanda-0.redpanda.redpanda.svc.cluster.local:8081'
             - 'redpanda-1.redpanda.redpanda.svc.cluster.local:8081'
             - 'redpanda-2.redpanda.redpanda.svc.cluster.local:8081'
            tls:
              caCertSecretRef:
                name: 'redpanda-default-cert'
                key: 'ca.crt'
            sasl:
              username: admin
              passwordSecretRef:
                name: redpanda-admin-user
                key: password
              mechanism: 'SCRAM-SHA-512'

However, as soon as I want to change something (for example I recently tried to add the schemRegistry section), the reconciliation (of Flux) fails because "ClusterSource is immutable":

{"level":"error","ts":"2025-03-10T17:02:02.092Z","msg":"Reconciliation failed after 441.574826ms, next try in 10m0s","controller":"kustomization","controllerGroup":"kustomize.toolkit.fluxcd.io","controllerKind":"Kustomization","Kustomization":{" name":"<REDACTED>","namespace":"flux-system"},"namespace":"flux-system","name":"<REDACTED>","reconcileID":"84144184-30b4-47e8-8629-08ffd440c785","revision":"main@sha1:60f9f329c07299ac3faede0614c24eb81a1a9bcc","error":"Topic/redpanda/<REDACTED> dry-run failed (Invalid): Topic.cluster.redpanda.com \"<REDACTED>\" is invalid: spec.cluster: Invalid value: \"object\": ClusterSource is immutable\n"}

Version info:

  • appVersion: v2.3.7-24.3.6
  • chartVersion: 0.4.40

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions