Skip to content

Instantly share code, notes, and snippets.

@neilkuan
Created December 24, 2020 01:46
Show Gist options
  • Select an option

  • Save neilkuan/b8de7ec141a4bc225448cbac939d6e43 to your computer and use it in GitHub Desktop.

Select an option

Save neilkuan/b8de7ec141a4bc225448cbac939d6e43 to your computer and use it in GitHub Desktop.
# get daemonset image name.
$ kubectl get ds ${DS_NAME} -o json -n kube-system | jq -r .spec.template.spec.containers[].image | sort -u
# get specify pod image name.
$ kubectl get pod -n kube-system | grep ${Pod_Name} | awk '{print $1}' | while read x; do kubectl get pod $x -o json -n kube-system | jq -r .spec.containers[].image; done
# force delete pod
$ kubectl delete pods ${Pod_Name} --grace-period=0 --force
# get all namespace pod image name
kubectl get po --all-namespaces -o json | jq -r .items[].spec.containers[].image | sort -u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment