Kubernetes livenessProbe/readinessProbe deploy problem

7/18/2019

I tried to apply my pod with livenessProbe and readinessProbe. The problem is that i get a error: after apply: kubectl apply -f test1.yaml

Error:

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)....
-- djkobi97
kubernetes
readinessprobe

1 Answer

7/18/2019

Check if you have a pod named test1 already running, when you apply your yaml, Kubernetes think you want to modify the pod already running, and this action only permits changes to specific fields like the message indicates. To check if there is a pod running check with this command.

kubectl get pod test1 

then delete the pod and apply your yaml.

kubectl delete pod test1

kubectl apply -f xxxx
-- EAT
Source: StackOverflow