Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete 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'
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.
✗ Incorrect
The correct API version for the current Strimzi Kafka custom resource is 'kafka.strimzi.io/v1beta2'.
2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ephemeral' when persistent storage is needed.
Incorrect casing or spelling of 'persistent-claim'.
✗ Incorrect
The correct storage type to use persistent volume claims in Strimzi is 'persistent-claim'.
3fill in blank
hardFix 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'
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.
✗ Incorrect
The 'tls' field expects a boolean value. Use 'true' to enable TLS.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Setting replication factor higher than the number of brokers.
Confusing partitions with replicas.
✗ Incorrect
The topic should have 3 partitions and a replication factor of 2 as specified.
5fill in blank
hardFill 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'
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.
✗ Incorrect
The user must be linked to 'my-cluster', use 'scram-sha-512' as type, and the correct key 'scram-sha-512' for authentication details.