diff --git a/add-ons/strimzi/README.md b/add-ons/strimzi/README.md new file mode 100644 index 0000000..9ecbeec --- /dev/null +++ b/add-ons/strimzi/README.md @@ -0,0 +1,40 @@ +# Deploying Strimzi on OpenShift + +This addon provides an easy way to install an Apache Kafka cluster, using [Strimzi](http://strimzi.io/) on [Minishift](https://github.com/minishift/minishift). + +Prerequisites: + + * [Installed and running](https://docs.okd.io/latest/minishift/getting-started/installing.html) Minishift + * [Installed](https://docs.okd.io/latest/minishift/command-ref/minishift_oc-env.html) OpenShift CLI + +## Start Minishift +The deployment works with Minishift default resources - 2 CPUs and 2 GB RAM. Nevertheless we prefer to allocate more memory (4 GB) available to Strimzi and associated infrastructure. Start Minishift using following command to provide more RAM. +``` +$ minishift start --memory=4GB +``` + +## Add-on installation +Clone this repository onto your local machine and then install the add-on via: +``` + $ minishift addons install +``` + +## Strimzi start +Deploy the Apache Kafka cluster: + +``` +minishift addon apply -a STRIMZI_VERSION=0.7.0 -a PROJECT=myproject +``` + +After a while all parts should be up and running, you can monitor the progress: + +``` +oc get pods -w +``` + +## Supported parameters +* `STRIMZI_VERSION` - the verson of Strimzi to be used (only released versions are supported) +* `PROJECT` - the name of the project to which Strimzi is deployed + +## Strimzi Documentation +To learn more about Strimzi, read the [Strimzi documentation](http://strimzi.io/). diff --git a/add-ons/strimzi/strimzi.addon b/add-ons/strimzi/strimzi.addon new file mode 100644 index 0000000..9bb0dad --- /dev/null +++ b/add-ons/strimzi/strimzi.addon @@ -0,0 +1,32 @@ +# Name: strimzi +# Description: Deploys an Apache Kafka Cluster +# Required-Vars: STRIMZI_VERSION +# Var-Defaults: STRIMZI_VERSION=0.7.0,PROJECT=strimzi + +# Pull images +echo Pulling images... +docker pull docker.io/strimzi/topic-operator:#{STRIMZI_VERSION} +docker pull docker.io/strimzi/entity-operator-stunnel:#{STRIMZI_VERSION} +docker pull docker.io/strimzi/user-operator:#{STRIMZI_VERSION} +docker pull docker.io/strimzi/cluster-operator:#{STRIMZI_VERSION} +docker pull docker.io/strimzi/kafka:#{STRIMZI_VERSION} +docker pull docker.io/strimzi/kafka-stunnel:#{STRIMZI_VERSION} +docker pull docker.io/strimzi/kafka-init:#{STRIMZI_VERSION} +docker pull docker.io/strimzi/zookeeper-stunnel:#{STRIMZI_VERSION} +docker pull docker.io/strimzi/zookeeper:#{STRIMZI_VERSION} + + +# Downloading Strimzi files +wget https://github.com/strimzi/strimzi-kafka-operator/releases/download/#{STRIMZI_VERSION}/strimzi-#{STRIMZI_VERSION}.tar.gz + +echo Applying Strimzi Templates +oc apply -f strimzi-#{STRIMZI_VERSION}/examples/install/cluster-operator -n #{PROJECT} +oc apply -f strimzi-#{STRIMZI_VERSION}/examples/templates/cluster-operator -n #{PROJECT} + +echo Waiting for Strimzi Cluster Operator to become ready +sleep 5; while echo && oc get pods -n myproject | grep -v -E "(Running|Completed|STATUS)"; do sleep 5; done + +echo Creating persistent Strimzi broker +oc apply -f strimzi-#{STRIMZI_VERSION}/examples/kafka/kafka-persistent.yaml -n #{PROJECT} + +echo Completed, wait for Strimzi start!