conduktor.io ↗

Schema Required for Non-Internal Topics

Every non-internal topic must have at least one registered schema subject.

Rationale

Untyped topics break consumers silently when payloads drift. A schema subject (via TopicNameStrategy or TopicRecordNameStrategy) gives you a contract and evolution control. Internal topics (`__*`, `_*`) are exempt.

Pattern

Topic has at least one subject in Schema Registry

Examples

prod.orders.placed.v1 → subject prod.orders.placed.v1-value exists
prod.events (no subject registered)

Parameters

NameDefaultDescription
subject_strategy "topic_name" `topic_name`, `record_name`, or `topic_record`.
exempt_prefixes ["__","_"] Topic prefixes that are exempt.

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
# Schema: https://docs.conduktor.io/platform/reference/resource-reference/self-service/#resourcepolicy
# Cross-resource lookups are NOT exposed in CEL today — ResourcePolicy rules
# evaluate against the resource being applied. Enforce from both sides:
#   1) Topic side (below): require a label declaring the schema subject.
#   2) Subject side: see subject-compatibility-not-none for compatibility pinning.
---
apiVersion: self-serve/v1
kind: ResourcePolicy
metadata:
  name: schema-required-non-internal
spec:
  targetKind: Topic
  description: Non-internal topics must declare a schema subject via labels.schema-subject
  rules:
    - condition: 'metadata.name.startsWith("__") || metadata.name.startsWith("_") || ("schema-subject" in metadata.labels && size(metadata.labels["schema-subject"]) > 0)'
      errorMessage: "Non-internal topics must set label schema-subject=<subject-name> (or be Schema-Registry-governed)"

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 →