Last active
December 26, 2018 10:11
-
-
Save lomkju/5976866b7df22170d0c9ea8fa8534d39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#DUMP yamls | |
kubectl get deploy | awk 'NR>1{ print $1 }' | xargs -I{} sh -c 'kubectl get deploy/$1 --export -o yaml > $1.yml' -- {} | |
#Rollout undo | |
kubectl get deploy | awk 'NR>1{ print $1 }' | xargs -I{} sh -c 'kubectl rollout undo deploy/$1' -- {} | |
#Delete all everything in a namespace | |
kubectl delete --all services,deployments,pods,ingress,secrets,configmaps | |
#Delete specific services | |
kubectl delete services $(kubectl get services | grep test | awk '{print $1}') | |
kubectl --kubeconfig=mondelez-development --namespace=staging delete pods $(kubectl --kubeconfig=mondelez-development --namespace=staging get pods -o=custom-columns=NAME:.metadata.name | grep mondelezrasa | awk '{print $1}') | |
#Run Local | |
kubectl run NAME -it --image=IMAGE --overrides='{ "apiVersion": "v1", "metadata": { "annotations" : { "iam.amazonaws.com/role": "IAM" } }, "spec": { "imagePullSecrets": [{"name": "registry"}] } }' --restart=Never --command -- /bin/sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment