Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Strimzi addon #164

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions add-ons/strimzi/README.md
Original file line number Diff line number Diff line change
@@ -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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

```
$ minishift start
```

## Add-on installation
Clone this repository onto your local machine and then install the add-on via:
```
$ minishift addons install <path_to_directory_containing_this_readme>
```

## 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/).
26 changes: 26 additions & 0 deletions add-ons/strimzi/strimzi.addon
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Name: strimzi
# Description: Deploys an Apache Kafka Cluster
# Required-Vars: STRIMZI_VERSION
# Var-Defaults: STRIMZI_VERSION=#{STRIMZI_VERSION},PROJECT=myproject
Copy link
Member

@anjannath anjannath Feb 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to provide a default version in the Var-Defaults, the idea is that the users do not have to pass in a version if they want to stay with the default one, otherwise if you want the user to every time pass in the version than remove STRIMZI_VERSION from Var-Defaults

# OpenShift-Version: >=3.10.0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


# 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!
16 changes: 16 additions & 0 deletions test/integration/features/strimzi.feature
Original file line number Diff line number Diff line change
@@ -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"