[英]Pod keeps in terminating on a terminated EC2 instance
我在 AWS 平台上創建了一個 Kube.netes 集群,並使用 DaemonSets 創建了 Pod。
實例終止后,對應的 pod 仍處於Terminating
狀態。
有人知道在 kube.netes master 中清理這樣的Terminating
pod 嗎?
您始終可以通過提供kubectl delete pod NAME --grace-period=0
。 您還可以使用kubectl delete node NAME
刪除該節點(如果您不打算將其恢復), kubectl delete node NAME
應該清理kubectl delete node NAME
。
以終止 pod 結束的常用方法是:
kubectl delete pod -n ${namespace} ${pod} --grace-period=0
但是您可能需要刪除可能阻止 POD 停止使用的終結器:
kubectl -n ${namespace} patch pod ${pod} -p '{"metadata":{"finalizers":null}}'
如果這些都不起作用,您可以使用 etcdctl 從 etcd 中刪除 pod:
# Define variables
ETCDCTL_API=3
certs-path=${HOME}/.certs/e
etcd-cert-path=${certs-path}/etcd.crt
etcd-key-path=${certs-path}/etcd.key
etcd-cacert-path=${certs-path}/etcd.ca
etcd-endpoints=https://127.0.0.1:2379
namespace=myns
pod=mypod
# Call etcdctl to remove the pod
etcdctl del \
--endpoints=${etcd-endpoints}\
--cert ${etcd-cert-path} \
--key ${etcd-client-key}\
--cacert ${etcd-cacert-path} \
--prefix \
/registry/pods/${namespace}/${pod}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.