forked from madhuakula/kubernetes-goat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
teardown-kubernetes-goat.sh
29 lines (23 loc) · 1.09 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
#!/bin/bash
# Author: Madhu Akula
# This program has been created as part of Kuberentes Goat
# Teardown Kuberentes Goat setup
# Removing the helm-tiller cluster role/binding
kubectl delete clusterrole all-your-base
kubectl delete clusterrolebindings belong-to-us
# Removing metadata db chart
helm2 delete metadata-db --purge
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
echo "The Kubernetes Goat scenarios has been removed. Ensure clean up what you installed and used, It's better to delete the cluster."