如何获取nameSpace

kubectl get namespaces

image.png

如何获取pod

sudo kubectl get pods -n prod -n prod 指定获取namespace为prod下面的pod

image.png
如何删除Evicted状态的pod

sudo kubectl get pod -n prod | grep Evicted | awk ‘{print $1}’ | xargs -i kubectl delete pod {} -n prod

sudo kubectl get pod -n prod | grep Evicted | awk ‘{print $1}’ | xargs kubectl delete pod -n prod

参考:https://www.cnblogs.com/linyouyi/p/11898189.html
参考:https://blog.csdn.net/nickDaDa/article/details/101027040