Skip to content

KafkaTopic

Usage example

apiVersion: aiven.io/v1alpha1
kind: KafkaTopic
metadata:
  name: kafka-topic
spec:
  authSecretRef:
    name: aiven-token
    key: token

  project: my-aiven-project
  serviceName: my-kafka
  topicName: my-kafka-topic

  replication: 2
  partitions: 1

  config:
    min_cleanable_dirty_ratio: 0.2

KafkaTopic

KafkaTopic is the Schema for the kafkatopics API.

Required

  • apiVersion (string). Value aiven.io/v1alpha1.
  • kind (string). Value KafkaTopic.
  • metadata (object). Data that identifies the object, including a name string and optional namespace.
  • spec (object). KafkaTopicSpec defines the desired state of KafkaTopic. See below for nested schema.

spec

Appears on KafkaTopic.

KafkaTopicSpec defines the desired state of KafkaTopic.

Required

  • partitions (integer, Minimum: 1, Maximum: 1000000). Number of partitions to create in the topic.
  • project (string, Immutable, MaxLength: 63, Format: ^[a-zA-Z0-9_-]+$). Identifies the project this resource belongs to.
  • replication (integer, Minimum: 2). Replication factor for the topic.
  • serviceName (string, Immutable, MaxLength: 63, Format: ^[a-z][-a-z0-9]+$). Specifies the name of the service that this resource belongs to.

Optional

  • authSecretRef (object). Authentication reference to Aiven token in a secret. See below for nested schema.
  • config (object). Kafka topic configuration. See below for nested schema.
  • tags (array of objects). Kafka topic tags. See below for nested schema.
  • termination_protection (boolean). It is a Kubernetes side deletion protections, which prevents the kafka topic from being deleted by Kubernetes. It is recommended to enable this for any production databases containing critical data.
  • topicName (string, Immutable, MinLength: 1, MaxLength: 249). Topic name. If provided, is used instead of metadata.name. This field supports additional characters, has a longer length, and will replace metadata.name in future releases.

authSecretRef

Appears on spec.

Authentication reference to Aiven token in a secret.

Required

  • key (string, MinLength: 1).
  • name (string, MinLength: 1).

config

Appears on spec.

Kafka topic configuration.

Optional

tags

Appears on spec.

Kafka topic tags.

Required

  • key (string, MinLength: 1, MaxLength: 64, Format: ^[a-zA-Z0-9_-]*$).

Optional

  • value (string, MaxLength: 256, Format: ^[a-zA-Z0-9_-]*$).