0
0
Kafkadevops~10 mins

Kafka on Kubernetes (Strimzi) - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a Kafka cluster using Strimzi with the correct API version.

Kafka
apiVersion: [1]
kind: Kafka
metadata:
  name: my-cluster
spec:
  kafka:
    replicas: 3
    listeners:
      - name: plain
        port: 9092
        type: internal
        tls: false
    storage:
      type: ephemeral
  zookeeper:
    replicas: 3
    storage:
      type: ephemeral
Drag options to blanks, or click blank then click option'
Akafka.strimzi.io/v2
Bkafka.strimzi.io/v1alpha1
Ckafka.strimzi.io/v1
Dkafka.strimzi.io/v1beta2
Attempts:
3 left
💡 Hint
Common Mistakes
Using an outdated or incorrect API version causes the resource to be rejected.
Confusing the API version with Kubernetes core API versions.
2fill in blank
medium

Complete the code to specify the storage type for Kafka brokers as persistent volume claims.

Kafka
spec:
  kafka:
    storage:
      type: [1]
      size: 10Gi
Drag options to blanks, or click blank then click option'
Apersistent-claim
BpersistentVolumeClaim
Cephemeral
Dpersistent-claim-volume
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ephemeral' when persistent storage is needed.
Incorrect casing or spelling of 'persistent-claim'.
3fill in blank
hard

Fix the error in the listener configuration to enable TLS for the external listener.

Kafka
spec:
  kafka:
    listeners:
      - name: external
        port: 9094
        type: nodeport
        tls: [1]
Drag options to blanks, or click blank then click option'
Afalse
Bno
Ctrue
Denabled
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings like 'enabled' or 'no' instead of boolean true/false.
Forgetting to enable TLS when required for security.
4fill in blank
hard

Fill both blanks to configure the Kafka topic with 3 partitions and a replication factor of 2.

Kafka
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaTopic
metadata:
  name: my-topic
  labels:
    strimzi.io/cluster: my-cluster
spec:
  partitions: [1]
  replicas: [2]
Drag options to blanks, or click blank then click option'
A3
B2
C1
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Setting replication factor higher than the number of brokers.
Confusing partitions with replicas.
5fill in blank
hard

Fill all three blanks to create a Kafka user with SCRAM-SHA-512 authentication and assign it to the cluster.

Kafka
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaUser
metadata:
  name: my-user
  labels:
    strimzi.io/cluster: [1]
spec:
  authentication:
    type: [2]
    [3]: {}
Drag options to blanks, or click blank then click option'
Amy-cluster
Bscram-sha-512
Dtls
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'tls' instead of SCRAM for authentication type.
Mismatching label cluster name and metadata name.
Incorrect casing in authentication keys.