From 75c652ba676a63598329ca6f4b723862c79e5ba8 Mon Sep 17 00:00:00 2001 From: Matthias Wessendorf Date: Sat, 29 Sep 2018 15:47:11 +0200 Subject: [PATCH] Adding Strimzi addon, using 0.8.2 --- add-ons/strimzi/README.md | 42 +++++++++++++++++++++++ add-ons/strimzi/strimzi.addon | 26 ++++++++++++++ test/integration/features/strimzi.feature | 16 +++++++++ 3 files changed, 84 insertions(+) create mode 100644 add-ons/strimzi/README.md create mode 100644 add-ons/strimzi/strimzi.addon create mode 100644 test/integration/features/strimzi.feature diff --git a/add-ons/strimzi/README.md b/add-ons/strimzi/README.md new file mode 100644 index 0000000..0ec58f0 --- /dev/null +++ b/add-ons/strimzi/README.md @@ -0,0 +1,42 @@ +# 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 4 GB RAM. +``` + $ minishift start +``` + +## 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, as a `cluster-admin` user: + +``` +oc login -u system:admin +... +minishift addon apply strimzi -a STRIMZI_VERSION=0.8.2 -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..d4ffa5f --- /dev/null +++ b/add-ons/strimzi/strimzi.addon @@ -0,0 +1,26 @@ +# Name: strimzi +# Description: Deploys an Apache Kafka Cluster +# Required-Vars: STRIMZI_VERSION +# Var-Defaults: STRIMZI_VERSION=#{STRIMZI_VERSION},PROJECT=myproject +# OpenShift-Version: >=3.10.0 + +# 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} + + +echo Applying Strimzi Install files (e.g. Roles, Bindings, CRDs) +oc apply -f https://github.com/strimzi/strimzi-kafka-operator/releases/download/#{STRIMZI_VERSION}/strimzi-cluster-operator-#{STRIMZI_VERSION}.yaml -n #{PROJECT} + +echo Creating persistent Strimzi broker +oc apply -f https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/#{STRIMZI_VERSION}/examples/kafka/kafka-persistent.yaml -n #{PROJECT} + +echo Completed, wait for Strimzi start! diff --git a/test/integration/features/strimzi.feature b/test/integration/features/strimzi.feature new file mode 100644 index 0000000..ec8cd3a --- /dev/null +++ b/test/integration/features/strimzi.feature @@ -0,0 +1,16 @@ +@strimzi +Feature: Feature for strimzi + + @minishift-only + Scenario: User installs strimzi add-on + When executing "minishift addons install ../../add-ons/strimzi" succeeds + Then stdout should contain "Addon 'strimzi' installed" + + Scenario: User can uninstall strimzi add-on + When executing "minishift addons uninstall strimzi" succeeds + Then stdout should contain "Add-on 'strimzi' uninstalled" + And stdout of command "minishift addons list" does not contain "strimzi" + + Scenario: Deleting Minishift + When executing "minishift delete --force" succeeds + Then Minishift should have state "Does Not Exist"