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
credentials for the Docker registry where Cloudera Streams Messaging - Kubernetes Operator artifacts are
hosted is available in the namespace where you plan on deploying your cluster. If the secret is
not available, create
it.
kubectl create secret docker-registry [***SECRET NAME***] \ --docker-server [***REGISTRY***] \ --docker-username [***USERNAME***] \ --docker-password [***PASSWORD***] \ --namespace [***NAMESPACE***]
- [***SECRET NAME***] must be the same as the name of the Secret containing registry credentials that you created during Strimzi installation.
- Replace [***REGISTRY***] with the server location of the Docker registry
where Cloudera Streams Messaging - Kubernetes Operator artifacts are hosted. If your Kubernetes cluster
has internet access, use
container.repository.cloudera.com
. Otherwise, enter the server location of your self-hosted registry. - Replace [***USERNAME***] and [***PASSWORD***] with
credentials that provide access to the registry. If you are using
container.repository.cloudera.com
, use your Cloudera credentials. Otherwise, enter credentials providing access to your self-hosted registry.
- 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.