forked from debezium/debezium-examples
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcreate-environment.sh
executable file
·33 lines (24 loc) · 1.1 KB
/
create-environment.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
#! /usr/bin/env bash
source env.sh
kind create cluster --name $CLUSTER
kubectl cluster-info --context kind-$CLUSTER
# Create namespace
echo ">>> Creating debezium namespace"
kubectl create namespace $NAMESPACE
kubectl config set-context --current --namespace $NAMESPACE
# Deploy PostgreSQL database
echo ">>> Deploying PostgreSQL"
kubectl create -f infra/001_postgresql.yml -n $NAMESPACE
# Deploy Strimzi Operator
echo ">>> Deploying Strimzi"
kubectl create -f https://strimzi.io/install/latest?namespace=$NAMESPACE -n $NAMESPACE
kubectl wait --for=condition=Available deployments/strimzi-cluster-operator --timeout=$TIMEOUT -n $NAMESPACE
# Deploy PostgreSQL database
echo ">>> Deploying Kafka Broker"
kubectl create -f infra/002_kafka-ephemeral.yml -n $NAMESPACE
# Wait until envrionment is ready
echo ">>> Waiting for Database and Kafka to be ready"
kubectl wait --for=condition=Available deployments/postgresql --timeout=$TIMEOUT -n $NAMESPACE
kubectl wait --for=condition=Ready kafkas/dbz-kafka --timeout=$TIMEOUT -n $NAMESPACE
echo ""
echo "Kubernetes environment with PostreSQL database and Kafka broker is ready"