Deploying Kafka
You can deploy a Kafka cluster by creating a Kafka and KafkaNodePool resource in the Kubernetes environment. Following cluster deployment you can validate your cluster with the console producer and consumer tools shipped with Kafka.
Deploying a Kafka Cluster
Learn how to deploy a Kafka cluster with the Strimzi Cluster Operator using Kafka and KafkaNodePool resources.
To deploy a Kafka cluster, you create two resources in the Kubernetes cluster. A Kafka resource and one or more KafkaNodePool resources. Based on these resources, the Strimzi Cluster Operator deploys the Kafka cluster.
- Kafka configuration that is common for the whole Kafka cluster (Kafka version, cluster name, and so on)
- ZooKeeper configuration
- Cruise Control configuration
- Entity Operator configuration
A KafkaNodePool resource refers to a distinct group of Kafka nodes within a Kafka cluster. Using node pools enables you to specify different configurations for each node within the same Kafka cluster. Configuration options not specified in the node pool are inherited from the Kafka configuration.
You can deploy a Kafka cluster with one or more node pools. The number of node pools you create depends on how many groups of Kafka brokers you want to have that have differing configurations. The node pool configuration includes mandatory and optional settings. Configuration for replicas, roles, and storage is mandatory.
- Ensure that the Strimzi Cluster Operator is installed and running.
- Ensure that the Secret containing your Cloudera credentials
is available in the namespace where you plan on deploying your Kafka cluster. If
the secret is not available, create
it.
kubectl create secret docker-registry [***SECRET NAME***] \ --docker-server container.repository.cloudera.com \ --docker-username [***USERNAME***] \ --docker-password [***PASSWORD***] \ --namespace [***NAMESPACE***]
- Replace [***USERNAME***] and [***PASSWORD***] with your Cloudera credentials.
- [***SECRET NAME***] must be the same as the name of the Secret that contains Cloudera credentials and exists in the Strimzi Cluster Operator namespace.
- The following steps contain an example Kafka and KafkaNodePool resource. You can find additional examples on the Cloudera Archive.
Validating a Kafka cluster
Validate your deployment using Kafka command line tools.
After the Kafka broker pods are successfully started, you can use the Kafka console producer and consumer to validate the environment. The following steps use the exact same docker images that were used to deploy the Kafka cluster by the Strimzi Cluster Operator. The images contain all the Kafka built-in tools and you can start a custom Kubernetes pod, starting the Kafka tools in the containers.