Creating a topic
Written by
Updated at April 8, 2026
If you have created a cluster, you can create a topic in it.
CLI
Management console
-
Create a file of the
KafkaTopicresource, e.g., using thetouch kafkatopic.yamlcommand. -
Open the file and paste the configuration below into it:
apiVersion: kafka.stackland.yandex.cloud/v1alpha1 kind: KafkaTopic metadata: name: kafka-topic-with-config labels: kafka-cluster: cluster-omdb spec: topicName: with-config partitions: 3 replicas: 3 config: retention.ms: 604800000 segment.bytes: 1073741824 -
Apply the manifest:
kubectl apply -f kafkatopic.yaml -n <project name>. Optionally, you can specify the project name in themetadata.namespaceresource property and skip it in the command.
- If you have not opened a project yet, select one.
- In the left-hand menu, select Kafka Clusters.
- Select a cluster.
- Go to the Topics tab.
- Click Create topic.
- Enter the topic name and click Create.