forked from georgep1ckers/tracey-reloaded
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-tracey.sh
executable file
·41 lines (30 loc) · 1.35 KB
/
run-tracey.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
35
36
37
38
39
40
41
#!/bin/bash
#install EBS driver
if kubectl get deploy -n kube-system | grep -q ebs; then
echo "EBS driver deployment already exists in the 'kube-system' namespace."
else
echo "No existing EBS driver deployment found. Proceeding with Helm update and installation."
helm repo add aws-ebs-csi-driver https://kubernetes-sigs.github.io/aws-ebs-csi-driver
helm repo update
helm upgrade aws-ebs-csi-driver aws-ebs-csi-driver/aws-ebs-csi-driver --namespace kube-system
fi
# Create db configmap
kubectl apply -f tracey-database/postgresql-configmap.yaml
# Create db persistant volume chain
kubectl apply -f tracey-database/postgresql-pvc.yaml
# Create db deployment
kubectl apply -f tracey-database/postgresql-deployment.yaml
# Create db service
kubectl apply -f tracey-database/postgresql-service.yaml
# Wait for the database to be ready
echo "Waiting for database to be ready..."
kubectl wait --for=condition=ready pod -l app=postgresql --timeout=300s
# Once the database is ready, deploy the services
echo "Database is ready. Deploying services..."
# Create tracey stock-controller deployment & service combined yaml
kubectl apply -f stock-controller.yaml
# Create tracey processor deployment & service combined yaml
kubectl apply -f order-processor.yaml
# Create tracey interface deployment yaml
kubectl apply -f warehouse-interface.yaml
echo "Services deployed."