Skip to content

Instantly share code, notes, and snippets.

@panzelva
Last active May 27, 2020 10:59
Show Gist options
  • Select an option

  • Save panzelva/4bb4db7f550f3743846ef67dabc68429 to your computer and use it in GitHub Desktop.

Select an option

Save panzelva/4bb4db7f550f3743846ef67dabc68429 to your computer and use it in GitHub Desktop.
Kubernetes
#!/bin/bash
# create temporary debug pod with network tools (ubuntu based)
kubectl run --rm debug -it --generator=run-pod/v1 --image arunvelsriram/utils bash
# create temporary debug pod with network tools (alpine based)
kubectl run --rm debug -it --generator=run-pod/v1 --image praqma/network-multitool sh
# delete all Errored pods in namespace
# WARNING! destructive
kubectl get pods --namespace gitlab-runners --no-headers=true | awk '$3 ~ /Error/' | awk '{print $1}' | xargs kubectl delete --namespace gitlab-runners pod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment