Skip to content

Instantly share code, notes, and snippets.

@dmarrazzo
Last active July 3, 2023 17:50
Show Gist options
  • Save dmarrazzo/04637d1a9858c93bc2495f214e58837a to your computer and use it in GitHub Desktop.
Save dmarrazzo/04637d1a9858c93bc2495f214e58837a to your computer and use it in GitHub Desktop.
MAD Roadshow Kafka hands on experience

Project

  1. Open the OpenShift Console
  2. From project drop down list, select Create Project
  3. In the name field type userX-kafka, then Create

Create Kafka custom resource

  1. Select the + icon in the top bar (top right)

  2. Copy the following yaml file:

    kind: Kafka
    apiVersion: kafka.strimzi.io/v1beta2
    metadata:
      name: my-cluster
    spec:
      kafka:
        version: 3.4.0
        replicas: 3
        listeners:
          - name: plain
            port: 9092
            type: internal
            tls: false
        config:
          offsets.topic.replication.factor: 3
          transaction.state.log.replication.factor: 3
          transaction.state.log.min.isr: 2
          default.replication.factor: 3
          min.insync.replicas: 2
        storage:
          type: ephemeral
      zookeeper:
        replicas: 3
        storage:
          type: ephemeral
      entityOperator:
        topicOperator: {}
        userOperator: {}
  3. Wait for the Ready status.

  4. Check the cluster configuration in the Topology view.

Create a topic

  1. Select the + icon in the top bar (top right)
  2. Copy the following yaml file:
    kind: KafkaTopic
    apiVersion: kafka.strimzi.io/v1beta2
    metadata:
      name: my-topic
      labels:
        strimzi.io/cluster: my-cluster
    spec:
      partitions: 12
      replicas: 3

Produce messages

  1. From the left menu select Project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment