Skip to content

Instantly share code, notes, and snippets.

@borg-z
Last active March 5, 2019 06:06
Show Gist options
  • Save borg-z/5cb0e66655eaef87d9f4f1b119997f15 to your computer and use it in GitHub Desktop.
Save borg-z/5cb0e66655eaef87d9f4f1b119997f15 to your computer and use it in GitHub Desktop.
k8s

Kubect

Get pods list

➜  ~ kubectl --no-headers=true -n default get pods | awk '{print $1}'
ads-fcb6555d-2wr9z
ads-fcb6555d-4f72n
ads-fcb6555d-bxtzh

Where is pods

➜  ~ kubectl --no-headers=true -n default get pods -o wide           
ads-fcb6555d-2wr9z  2/2   Running   51     38d   10.233.66.82     n1   <none>
ads-fcb6555d-4f72n  2/2   Running   34     23d   10.233.66.83     n1   <none>
ads-fcb6555d-bxtzh  2/2   Running   24     23d   10.233.123.105   n3   <none>

Set kubeconfig

KUBECONFIG=$KUBECONFIG:$HOME/.kube-dev/config kubectl get nodes

Delete evicted pods

kubectl get pods -n informers | grep Evicted | awk '{print $1}'  | xargs kubectl -n informers delete pod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment