Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save srkiNZ84/6131ee2c9c747fc8f4ed211af9e77099 to your computer and use it in GitHub Desktop.
Save srkiNZ84/6131ee2c9c747fc8f4ed211af9e77099 to your computer and use it in GitHub Desktop.
#!/bin/bash
KUBECOMMAND="kubectl --kubeconfig ~/.kube/mycluster --namespace dev"
for each in $($KUBECOMMAND get deployments -o jsonpath="{.items[*].metadata.name}" | tr " " "\n" | grep -v tiller-deploy);
do
#kubectl delete ns $each
echo "Deleting deployment $each"
$KUBECOMMAND delete deployment $each
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment