forked from madhuakula/kubernetes-goat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
teardown-kubernetes-goat.sh
35 lines (27 loc) · 1.3 KB
/
teardown-kubernetes-goat.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
#!/bin/bash
# Author: Madhu Akula
# This program has been created as part of Kuberentes Goat
# Teardown Kuberentes Goat setup
# Removing the superadmin cluster role/binding
kubectl delete clusterrolebindings superadmin
kubectl delete serviceaccount -n kube-system superadmin
# Removing the helm-tiller cluster role/binding
kubectl delete clusterrole all-your-base
kubectl delete clusterrolebindings belong-to-us
# Removing metadata db chart
helm delete metadata-db --no-hooks
# helm2 delete pwnchart --purge
# Remove tiller deployment
kubectl delete deployments -n kube-system tiller-deploy
# Delete the scenarios
kubectl delete -f scenarios/batch-check/job.yaml
kubectl delete -f scenarios/build-code/deployment.yaml
kubectl delete -f scenarios/cache-store/deployment.yaml
kubectl delete -f scenarios/health-check/deployment.yaml
kubectl delete -f scenarios/hunger-check/deployment.yaml
kubectl delete -f scenarios/internal-proxy/deployment.yaml
kubectl delete -f scenarios/kubernetes-goat-home/deployment.yaml
kubectl delete -f scenarios/poor-registry/deployment.yaml
kubectl delete -f scenarios/system-monitor/deployment.yaml
kubectl delete -f scenarios/hidden-in-layers/deployment.yaml
echo "The Kubernetes Goat scenarios has been removed. Ensure clean up what you installed and used, It's better to delete the cluster."