[K8S]Forbidden: pod updates may not change fields other than
背景
在执行kubectl apply -f pod-nginx.yaml的时候报错
The Pod "nginx-test" is invalid: spec: Forbidden: pod updates may not change fields other than `spec.containers[*].image`, `spec.initContainers[*].image`, `spec.activeDeadlineSeconds`, `spec.tolerations` (only additions to existing tolerations) or `spec.terminationGracePeriodSeconds` (allow it to be set to 1 if it was previously negative)
core.PodSpec{
... // 9 identical fields
ServiceAccountName: "default",
AutomountServiceAccountToken: nil,
- NodeName: "k8s-node1",
+ NodeName: "k8s-node2",