forked from cescoffier/reactive-coffeeshop-demo
-
Notifications
You must be signed in to change notification settings - Fork 4
/
install.sh
executable file
·34 lines (26 loc) · 1.49 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
# Create namespaces for Strimzi and Kafka
kubectl create ns strimzi
kubectl create ns kafka
# Install Strimzi Helm chart
helm repo add strimzi https://strimzi.io/charts
helm install strimzi strimzi/strimzi-kafka-operator -n strimzi --set watchNamespaces={kafka} --wait --timeout 300s
# Install Strimzi custom resource, and wait for cluster creation
kubectl apply -f kafka-strimzi.yml -n kafka
kubectl wait --for=condition=Ready kafkas/my-cluster -n kafka --timeout 180s
# Create namespace for Keda
kubectl create ns keda
# Install Keda Helm chart
helm repo add kedacore https://kedacore.github.io/charts
helm install keda kedacore/keda -n keda --wait --timeout 300s
# Wait for Keda apiservice to be ready (otherwise further Helm installs will fail)
kubectl wait --for=condition=Available --timeout=60s apiservices/v1beta1.external.metrics.k8s.io
# Install coffeeshop-demo into coffee namespace. Requires that Kafka cluster
# is already created. Contains custom resources:
# - Strimzi: CRs for orders and queue topics (installed into kafka ns)
# - Keda: ScaledObject for barista-kafka service (installed into coffee ns)
kubectl create ns coffee
helm install coffee-v1 ./coffeeshop-chart -n coffee --wait --timeout 300s
# To pull images from a remote repo, override the image repository.
# Eg: --set baristaKafka.image.repository=registry:5000/barista-kafka --set baristaHttp.image.repository=registry:5000/barista-http --set coffeeshopService.image.repository=registry:5000/coffeeshop-service
./postinstall.sh