24 lines
705 B
Bash
24 lines
705 B
Bash
#!/usr/bin/env bash
|
|
# Remove the application from local Kubernetes
|
|
|
|
set -e
|
|
|
|
kubectl config use-context docker-desktop
|
|
|
|
NAMESPACE="my-app"
|
|
|
|
echo "Deleting web application..."
|
|
kubectl delete -f service.yaml -n ${NAMESPACE} --ignore-not-found
|
|
kubectl delete -f deployment.yaml -n ${NAMESPACE} --ignore-not-found
|
|
|
|
echo "Deleting PostgreSQL..."
|
|
kubectl delete -f postgres-service.yaml -n ${NAMESPACE} --ignore-not-found
|
|
kubectl delete -f postgres-deployment.yaml -n ${NAMESPACE} --ignore-not-found
|
|
|
|
echo "Deleting storage..."
|
|
kubectl delete -f persistent-storage.yaml -n ${NAMESPACE} --ignore-not-found
|
|
|
|
echo "Deleting namespace..."
|
|
kubectl delete -f namespace.yaml --ignore-not-found
|
|
|
|
echo "Cleanup complete." |