Getting up and running with a Apache Kafka cluster on Kubernetes and OKD can be very simple, when using the Strimzi project! This quick start guide walks you through a quick and easy install for your development environment, using OKD.
This assumes that you have the latest version of the oc binary, which you can get here.
oc cluster upThis will start a local installation of OKD. Once this is completed, login as a cluster-admin user:
# Install as cluster-admin
oc login -u system:admin
# Setup Strimzi
oc project myprojectNext we are applying the Strimzi install files, including ClusterRoles, ClusterRoleBindings and some Custom Resource Definitions (CRDs) for the Apache Kafka itself, or creating Apache Kafka topics:
oc apply -f https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.8.1/strimzi-cluster-operator-0.8.1.yaml -n myprojectNext, we feed Strimzi with a simple Custom Resource, which will than give you a simple, ephemeral Apache Kafka Cluster:
# Apply the `Kafka` Cluster CR file, with exposed IP
oc apply -f https://gist.githubusercontent.com/matzew/a57485deff91591a442dcf6c7ab16c87/raw/4c90042c8b7151b614b8a81ccb1a76955046348c/strimzi.yaml -n myprojectWe can now watch the deployment, and see all required pods being created:
watch oc get pods -n myprojectNow, we need to lookup the EXTERNAL-IP which will be used connecting your application to Apache Kafka:
oc get service -n myproject -l strimzi.io/name=my-cluster-kafka-external-bootstrapEnjoy your Apache Kafka cluster, running on OKD!