-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy_gke.sh
70 lines (47 loc) · 2.23 KB
/
deploy_gke.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
echo "Setting postgres config..."
kubectl apply -f ./kubernetes/postgres/postgres-config.yaml
echo "Creating the database credentials..."
kubectl apply -f ./kubernetes/postgres/postgres-secret.yaml
echo "Creating the volume..."
kubectl apply -f ./kubernetes/postgres/postgres-storage.yaml
echo "Creating the postgres deployment and service..."
kubectl apply -f ./kubernetes/postgres/postgres-deployment.yaml
kubectl apply -f ./kubernetes/postgres/postgres-service.yaml
echo "waiting 10 seconds for postgres to start..."
sleep 10
echo "Check pods info to see if postgres has begun.."
kubectl get pods
echo "Creating the database networkpolicy..."
kubectl apply -f ./kubernetes/postgres/postgres-network-policy.yaml
echo "Creating the role for pods..."
kubectl apply -f ./kubernetes/roles/pod-role.yaml
echo "Creating the binding role for pods..."
kubectl apply -f ./kubernetes/roles/pod-role-binding.yaml
echo "Creating the role for volumes..."
kubectl apply -f ./kubernetes/roles/volumes-role.yaml
echo "Creating the binding role for volumes..."
kubectl apply -f ./kubernetes/roles/volumes-role-binding.yaml
echo "Creating the role for secrets..."
kubectl apply -f ./kubernetes/roles/secrets-role.yaml
echo "Creating the binding role for secrets..."
kubectl apply -f ./kubernetes/roles/secrets-role-binding.yaml
echo "Creating the flask deployment and service..."
kubectl create -f ./kubernetes/flask/flask-deployment.yaml
kubectl create -f ./kubernetes/flask/flask-service.yaml
kubectl create -f ./kubernetes/flask/flask-network-policy.yaml
kubectl create -f ./kubernetes/flask/flask-ingress.yaml
echo "Waiting 10 secs for flask to begin..."
sleep 10
echo "Check pods again to see if rest-api pod is running..."
kubectl get pods
echo "Creating web-frontend deployment and service..."
kubectl apply -f ./kubernetes/web-frontend/web-frontend-managed-cert.yaml
kubectl apply -f ./kubernetes/web-frontend/web-deployment.yaml
kubectl apply -f ./kubernetes/web-frontend/web-service.yaml
kubectl apply -f ./kubernetes/web-frontend/web-network-policy.yaml
kubectl apply -f ./kubernetes/web-frontend/web-ingress.yaml
echo "Wait for web-frontend pods to show up..."
sleep 10
echo "Check pods again to see if web-frontend pod is running..."
kubectl get pods