conduktor.io ↗

Partition Count Bounds

Topics must have between 1 and 12 partitions and be 1, 2, 3, 6, or 12 (divisible by 2, 3, or 6).

“Somebody created a topic with arbitrary number of partitions.”

Rationale

12 partitions is already a lot. Going higher slows rebalances, inflates controller metadata, raises open-file handles, and is almost always wishful-thinking provisioning rather than a real throughput need. Capping at 12 with a divisor-rich shape (1, 2, 3, 6, 12) keeps consumer-group assignment balanced — when `partitions % consumers != 0`, range/cooperative-sticky assignors hand one consumer an extra partition forever. Topics that genuinely need more must declare `labels.partition-override-approved=true`, which forces a conversation with the platform team.

Pattern

partitions in [1, 2, 3, 6, 12] OR labels.partition-override-approved == "true"

Examples

partitions: 6
partitions: 12
partitions: 200 with labels.partition-override-approved=true
partitions: 0
partitions: 5
partitions: 24
partitions: 4096

Parameters

NameDefaultDescription
allowed_values [1,2,3,6,12] Allowed partition counts without override.
override_label "partition-override-approved" Label key (value "true") that authorizes a partition count outside the allowlist.

Governs

This policy relates to the following Kafka configuration keys:

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
# Allowed list keeps partitions divisor-rich so consumer-group assignment is
# balanced (1, 2, 3, 6, 12 all share clean divisors with common consumer-group
# sizes). For genuine high-throughput needs, set
# metadata.labels.partition-override-approved=true (forces platform-team review).
---
apiVersion: self-serve/v1
kind: ResourcePolicy
metadata:
  name: partition-count-bounds
spec:
  targetKind: Topic
  description: partitions must be in [1, 2, 3, 6, 12] (override via labels.partition-override-approved=true)
  rules:
    - condition: '(has(metadata.labels) && "partition-override-approved" in metadata.labels && metadata.labels["partition-override-approved"] == "true") || spec.partitions in [1, 2, 3, 6, 12]'
      errorMessage: "Partitions must be one of [1, 2, 3, 6, 12] (set label partition-override-approved=true to request an override)"

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 →