-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun-k8.sh
66 lines (43 loc) · 1.55 KB
/
run-k8.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
#!/bin/bash
# run infrastructure
if [[ "$1" = "infra" ]]; then
# create keycloack secret
kubectl create secret generic keycloak-secrets --from-file=infra/keycloak/keycloak_secrets
# spin up the infra services
# not like in docker setup this will create all the infra services.
for file in $(find infra -name '*.yaml'); do kubectl apply -f $file; done
elif [[ "$1" = "database" ]]; then
# create db
kubectl apply -f infra/postgres/
elif [[ "$1" = "keycloak" ]]; then
# create keycloack secret
kubectl create secret generic keycloak-secrets --from-file=infra/keycloak/keycloak_secrets
# create keycloack ingress
kubectl apply -f kubeadm/keycloack-ingress.yaml
# spin up the keycloak instance
kubectl apply -f infra/keycloack/
elif [[ "$1" = "solr" ]]; then
# create solr ingress
kubectl apply -f kubeadm/solr-ingress.yaml
# spin up the solr instance
kubectl apply -f infra/solr/
elif [[ "$1" = "services" ]]; then
# create services ingress
kubectl apply -f kubeadm/services-ingress.yaml
# apply the global configs
kubectl apply -f services/global-config.yaml
# run all services
for file in $(find services -name '*.yaml'); do kubectl apply -f $file; done
elif [[ "$1" = "restart-single" ]]; then
# restart service
# delete pod
kubectl delete -f services/$2
# create services ingress
kubectl apply -f services/$2
elif [[ "$1" = "services-logs" ]]; then
# have to provide the pod name to view the logs
kubectl logs $2 -f
else
echo "Invalid usage"
exit 2
fi