Skip to content

Create a Kafka topic

This guide will show you how to create a Kafka topic

0. Creating topics

.nais/topic.yaml
apiVersion: kafka.nais.io/v1
kind: Topic
metadata:
  name: <MY-TOPIC>
  namespace: <MY-TEAM>
  labels:
    team: <MY-TEAM>
spec:
  pool: <MY-POOL> # TODO: link to available tenant pools
  acl:
    - team: <MY-TEAM>
      application: <MY-APP>
      access: readwrite   # read, write, readwrite

See the Kafka topic reference for a complete list of available options.

1. Grant access to the topic for other applications (optional)

See manage access for how to grant access to your topic.

2. Apply the Topic resource

Add the file to your application repository to deploy with NAIS github action.

kubectl apply -f ./nais/topic.yaml --namespace=<MY-TEAM> --context=<MY-CLUSTER>