kafka-users

by Spartan

Helm chartv0.1.0App 1.0.0

KafkaUser CRD instances reconciled by the Strimzi User Operator (deployed by the sibling `strimzi-user-operator` chart). One CRD per principal whose ACL we manage on AWS MSK. Credentials themselves live in AWS Secrets Manager (managed by infra-terraform); these CRDs use `authorization.type: simple` ONLY — no `authentication:` block.

About this chart

kafka-users

Declarative KafkaUser CRD instances for use with the strimzi-user-operator chart pointed at an external Kafka cluster (designed for AWS MSK but works against any Kafka the operator can reach).

This chart only produces KafkaUser Custom Resources from a users[] list you supply. The Strimzi User Operator pod and the KafkaUser CRD definition itself come from the sibling strimzi-user-operator chart.

When to use

Use this chart immediately after deploying strimzi-user-operator. Together, they realise a GitOps flow for Kafka ACL: declare a KafkaUser here, ArgoCD (or any Helm-managed pipeline) syncs the CRD, the operator reconciles ACL on Kafka via the Admin API.

All bundled KafkaUser declarations use authorization.type: simple ONLY — no authentication: block. Credential lifecycle stays with whoever created the SCRAM/mTLS principal upstream (e.g. Terraform).

Values

KeyTypeDefaultDescription
clusterLabelstring""Value of the required strimzi.io/cluster label on each KafkaUser. Standalone UO does not require a matching Kafka CR; the label namespaces KafkaUsers by target cluster. Pick a stable string per environment (e.g. msk-dev).
namespacestringkafka-aclNamespace for the KafkaUser instances — must match where the operator watches.
userslist[]List of principals whose ACL this chart manages. See schema below. Empty by default.

users[] entry schema

KeyTypeRequiredDescription
namestringyesKafka principal name — becomes the KafkaUser metadata.name and the SCRAM username the ACL applies to.
aclslistyesList of Strimzi ACL rules — passed verbatim into spec.authorization.acls. See the upstream AclRule reference.
labelsmapnoExtra labels merged into the rendered KafkaUser metadata.
annotationsmapnoExtra annotations on the rendered KafkaUser metadata.

Example consumer (ArgoCD Application)

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: kafka-users-dev
spec:
  source:
    repoURL: https://spartan-stratos.github.io/helm-charts
    chart: kafka-users
    targetRevision: 0.1.0
    helm:
      releaseName: kafka-users
      valuesObject:
        clusterLabel: msk-dev
        namespace: kafka-acl
        users:
          # Self-grant for the operator's own admin principal — must exist
          # before the consumer flips `allow.everyone.if.no.acl.found = false`
          # on the cluster, otherwise the operator locks itself out.
          - name: kafka-acl-admin
            acls:
              - resource: { type: cluster }
                operations: [Alter, AlterConfigs, Describe, DescribeConfigs]
                type: allow

          # Example producer principal — Write/Describe on a topic prefix,
          # IdempotentWrite at the cluster level (required for
          # enable.idempotence = true), and an explicit Deny on a foreign
          # topic prefix for defense in depth.
          - name: my-producer
            acls:
              - resource:
                  type: topic
                  name: "my-prefix."
                  patternType: prefix
                operations: [Write, Describe]
                type: allow
              - resource: { type: cluster }
                operations: [IdempotentWrite]
                type: allow
              - resource:
                  type: topic
                  name: "other-prefix."
                  patternType: prefix
                operations: [All]
                type: deny
  destination:
    namespace: kafka-acl

Bootstrap chicken-and-egg

The operator's admin principal needs ACL on the cluster before it can write any ACL — but only itself can write that ACL. If you operate against AWS MSK (or any cluster where you cannot set super.users), rely on Kafka's default allow.everyone.if.no.acl.found = true: while that flag is on, any authenticated principal can write ACL. The first users[] entry should be the operator's own self-grant (Alter Cluster etc.), applied during this window. After you flip allow.everyone.if.no.acl.found = false on the cluster, the operator keeps working via the explicit ACL it wrote for itself.

Deploy kafka-users with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kafka-users on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartkafka-users is pinned at v0.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply