编程技术分享平台

网站首页 > 技术教程 正文

k8s删除pod时报错(k8s强制删除pod不重启)

xnh888 2024-10-14 19:37:25 技术教程 36 ℃ 0 评论


1、命令:kubectl delete pod pod/nginx-7848d4b86f-fd6xl -n dev


error: there is no need to specify a resource type as a separate argument when passing arguments in resource/name form (e.g. 'kubectl get resource/<resource_name>' instead of 'kubectl get resource resource/<resource_name>'


意思是使用create创建的pod删除时不需要制定参数的类型也就是上面命令中的pod

使用kubectl delete pod/nginx-7848d4b86f-fd6xl -n dev,这样可以直接删除,但是由于由pod控制器,会自动再建一个nginx的容器,所以pod的数量是没有变得,如果想彻底删除,就需要先把deployment删除,然后再删pod


2、删除deployment

kubectl delete deployment.apps/nginx -n dev


Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表