generated from delftdata/wdm-project-template
/
deploy-to-cluster.sh
34 lines (30 loc) · 1.4 KB
/
deploy-to-cluster.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
#!/usr/bin/env bash
# First install helm charts
echo "Updating helm repos and installing charts"
sh deploy-charts-cluster.sh no-promstack
echo "Launching pods"
kubectl apply -f k8s/kubegres/base-kubegres-configy.yaml
kubectl apply -f k8s/kubegres/custom-postgres-config.yaml
sleep 5
kubectl apply -f k8s/kubegres/kubegres.yml
kubectl apply -f k8s/rabbitmq/cluster-operator.yml
sleep 5
kubectl apply -f k8s/rabbitmq/rabbitmq.yaml
echo "Waiting for kubegres to be ready"
kubectl wait --for=condition=available deployment -l control-plane=controller-manager -n kubegres-system
echo "Launching postgres clusters"
kubectl apply -f k8s/database-deployments
echo "Waiting for postgres clusters"
sleep 10
kubectl wait --for=condition=ready pod -l app=stock-postgres-service
kubectl wait --for=condition=ready pod -l app=user-postgres-service
kubectl wait --for=condition=ready pod -l app=order-postgres-service
echo "Launching services"
kubectl apply -f k8s/
echo "Waiting for services"
kubectl wait --for=condition=available deployment -l type=app-deployment
echo "Shopping cart endpoint:"
echo "http://$(kubectl get ingress app-ingress-service --output jsonpath='{.status.loadBalancer.ingress[0].ip}')"
echo "Pods launched, cluster ready (Some postgres instances might not have started yet, please wait until they are done, 3 instances per service should be running)"
echo "kubectl get pod | grep postgres"
kubectl get pod | grep postgres