简体   繁体   English

kubectl 删除 pod 与单击 GKE Web ui 上的删除按钮

[英]kubectl delete pod vs click delete button on GKE web ui

we have pods on GKE .我们在GKE上有豆荚。

we can delete pod by kubectl -n <ns> delete pod <pod name> .我们可以通过kubectl -n <ns> delete pod <pod name> we can also delete the pod by clicking the following delete button.我们也可以通过点击下面的删除按钮来删除 pod。

在此处输入图片说明

what are the differences?有什么区别? what are the results if I did both?如果我两者都做,结果会怎样?

thanks谢谢

UPDATE更新

thanks.谢谢。 The pod has terminationGracePeriodSeconds: 60 .该 pod 具有terminationGracePeriodSeconds: 60 what will happen if I run kubectl delete pod pod_name and then ctrl C ?如果我运行kubectl delete pod pod_name然后ctrl C会发生什么? Then click the delete button on the web ui?然后点击web ui上的删除按钮? all these are in 60 seconds.所有这些都在 60 秒内。

I am curious whether it will delete the pod by force without waiting for 60 seconds.我很好奇它是否会在不等待 60 秒的情况下强制删除 pod。

thanks谢谢

$ kubectl -n ns delete pod pod-0
pod "pod-0" deleted
^C

Both trigger the same API call to the kube-apiserver.两者都会触发对 kube-apiserver 的相同 API 调用。 If you try to delete something twice, the second call will fail either "already deleted" or "not found".如果您尝试两次删除某些内容,则第二次调用将失败“已删除”或“未找到”。

Well as @codegenerator answered is correct. @codegenerator 的回答是正确的。

About your updated question answer is关于您更新的问题答案是

The Pod will stays in a Terminating state and is killed after terminationGracePeriodSeconds of pod ends. Pod 将保持 Termination 状态,并在 Pod 的终止 GracePeriodSeconds 结束后被杀死。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM