Created
August 14, 2019 07:38
-
-
Save matzew/f0887745ba658313a0adbb54775b34b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
# Turn colors in this script off by setting the NO_COLOR variable in your | |
# environment to any value: | |
# | |
# $ NO_COLOR=1 test.sh | |
NO_COLOR=${NO_COLOR:-""} | |
if [ -z "$NO_COLOR" ]; then | |
header=$'\e[1;33m' | |
reset=$'\e[0m' | |
else | |
header='' | |
reset='' | |
fi | |
kube_version="v1.13.4" | |
strimzi_version=`curl https://github.com/strimzi/strimzi-kafka-operator/releases/latest | awk -F 'tag/' '{print $2}' | awk -F '"' '{print $1}' 2>/dev/null` | |
function header_text { | |
echo "$header$*$reset" | |
} | |
header_text "Using Strimzi Version: ${strimzi_version}" | |
header_text "Strimzi install" | |
oc create namespace kafka | |
curl -L "https://github.com/strimzi/strimzi-kafka-operator/releases/download/${strimzi_version}/strimzi-cluster-operator-${strimzi_version}.yaml" \ | |
| sed 's/namespace: .*/namespace: kafka/' \ | |
| oc -n kafka apply -f - | |
header_text "Applying Strimzi Cluster file" | |
oc -n kafka apply -f "https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/${strimzi_version}/examples/kafka/kafka-persistent-single.yaml" | |
header_text "Waiting for Strimzi to become ready" | |
sleep 5; while echo && oc get pods -n kafka | grep -v -E "(Running|Completed|STATUS)"; do sleep 5; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment