如何永久删除kubernetes中的单个pod

How to delete single pod in kubernetes permanently

我想永久删除 kubernetes 的单个 pod,但它会重新创建该 pod

我尝试了很多命令,但对我没有帮助。

1. kubectl delete pod <pod-name>

第二

kubectl get deployments

kubectl delete deployments <deployments- name>
kubectl get rs --all-namespaces
kubectl delete rs your_app_name

但 None 有效

my replica count is 0

...it will successfully delete the pod but then after it will restart

尝试:

apiVersion: v1
kind: Pod
metadata:
  name: ...
spec:
  restartPolicy: Never  # <-- add this
  containers:
  - name: ...

如果 pod 仍然重启,post 输出 kubectl describe pod <pod name> --namespace <name> 到你的问题。