-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathk8s-undeploy.sh
More file actions
41 lines (34 loc) · 1.19 KB
/
k8s-undeploy.sh
File metadata and controls
41 lines (34 loc) · 1.19 KB
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
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
K8S_DIR="$SCRIPT_DIR/k8s"
NAMESPACE="cityzen"
kubectl delete -f "$K8S_DIR/hpa.yaml" --ignore-not-found=true
kubectl delete -f "$K8S_DIR/ingress.yaml" --ignore-not-found=true
kubectl delete -f "$K8S_DIR/frontend-deployment.yaml" --ignore-not-found=true
BACKEND_SERVICES=(
"account-service"
"analytics-service"
"assignment-service"
"authentication-service"
"feedback-service"
"geolocation-service"
"map-service"
"media-service"
"notification-service"
"parameter-configuration-service"
"registration-service"
"report-service"
"ticket-service"
)
for service in "${BACKEND_SERVICES[@]}"; do
kubectl delete -f "$K8S_DIR/${service%-service}-deployment.yaml" --ignore-not-found=true
done
for service in "${BACKEND_SERVICES[@]}"; do
configmap="$K8S_DIR/${service%-service}-configmap.yaml"
[ -f "$configmap" ] && kubectl delete -f "$configmap" --ignore-not-found=true
done
for service in "${BACKEND_SERVICES[@]}"; do
kubectl delete secret "${service%-service}-secret" -n "$NAMESPACE" --ignore-not-found=true
done
kubectl delete secret minio-secret -n "$NAMESPACE" --ignore-not-found=true