Kubernetes livenessProbe/readinessProbe 部署问题

Kubernetes livenessProbe/readinessProbe deploy problem

我尝试使用 livenessProbe 和 readinessProbe 应用我的 pod。 问题是我得到一个错误:应用后:kubectl apply -f test1.yaml

错误:

The Pod "test1" is invalid: spec: Forbidden: pod updates may not change fields other than `spec.containers[*].image`, `spec.initContainers[*].image`, `spec.activeDeadlineSeconds` or `spec.tolerations` (only additions to existing tolerations)....

检查您是否已经有名为 test1 的 pod 运行,当您应用您的 yaml 时,Kubernetes 认为您已经想要修改 pod 运行,并且此操作仅允许更改特定字段如消息所示。 要检查是否有 pod 运行 使用此命令检查。

kubectl get pod test1 

然后删除 pod 并应用您的 yaml。

kubectl delete pod test1

kubectl apply -f xxxx