conduktor.io ↗

Topic Name Must Include Declared domain Label as Prefix

Topic name must start with the `domain` label value.

Rationale

When teams set `domain: payments` but name the topic `clickstream.events.v1`, ACLs scoped by prefix break and chargeback aggregation breaks. Force the name and the label to agree at admission time.

Pattern

metadata.name starts with "<domain>." (where <domain> = metadata.labels.domain)

Examples

name=payments.tx.v1 + labels.domain=payments
name=clickstream.events + labels.domain=payments (mismatch)

Implementation

Drop this YAML into Conduktor Console as a ResourcePolicy, then link it from an ApplicationInstance, Application, or KafkaCluster.

Conduktor ResourcePolicy
# Conduktor self-service ResourcePolicy
---
apiVersion: self-serve/v1
kind: ResourcePolicy
metadata:
  name: topic-domain-prefix-matches-app
spec:
  targetKind: Topic
  description: topic name must start with "<domain>." matching metadata.labels.domain
  rules:
    - condition: 'has(metadata.labels.domain) && metadata.name.startsWith(metadata.labels.domain + ".")'
      errorMessage: "topic name must start with \"<domain>.\" matching metadata.labels.domain (keeps naming, ACL prefix and chargeback in sync)"

Related policies

Try Conduktor Console

Enforce policies like this across your team — central audit history, pre-commit guardrails, ApplicationInstance bindings. 5-min Docker install.

Get Started →