Skip to content

Instantly share code, notes, and snippets.

@Stono
Created April 26, 2018 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Stono/a0d8883cca7206382cd5d2af74193d0c to your computer and use it in GitHub Desktop.
Save Stono/a0d8883cca7206382cd5d2af74193d0c to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Deleting istio components..."
array=( istio istio-crd istio-grafana istio-prometheus istio-jaeger kube-state-metrics prometheus-alertmanager )
for i in "${array[@]}"
do
echo " - Removing: $i"
helm del --purge $i
done
echo "Removing all custom resource definitions..."
kubectl get crd | grep -i istio | awk '{print $1}' | xargs -n 1 kubectl delete crd
echo "Deleting istio namespace..."
kubectl delete --cascade namespace istio-system
echo "Removing all istio secrets..."
kubectl get secrets --all-namespaces | grep "istio\." | awk '{print "kubectl delete secret -n "$1" "$2}' | bash -
echo "Removing mutating webhook stuff..."
kubectl delete MutatingWebhookConfiguration istio-sidecar-injector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment