conduktor.io ↗

Compression Allowlist

compression.type must be lz4 or zstd. No uncompressed in production.

Rationale

Uncompressed Kafka traffic costs 3–10x the bandwidth and disk versus a real codec. `gzip` is slow and CPU-heavy; `snappy` is acceptable but lz4/zstd win on the throughput/CPU tradeoff on modern Kafka.

Pattern

compression.type in ['lz4', 'zstd']

Examples

compression.type: lz4
compression.type: zstd
compression.type: none
compression.type: gzip
compression.type: producer

Parameters

NameDefaultDescription
allowed ["lz4","zstd"] Allowed compression codecs.

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
---
apiVersion: self-serve/v1
kind: ResourcePolicy
metadata:
  name: compression-allowlist
spec:
  targetKind: Topic
  description: compression.type must be lz4 or zstd
  rules:
    - condition: '"compression.type" in spec.configs && spec.configs["compression.type"] in ["lz4", "zstd"]'
      errorMessage: "compression.type must be lz4 or zstd"

Try Conduktor Console

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

Get Started →