I wonder why only some fields of a pod can be modified。 The updateable fields are:
In my actual business, I have a need to change the schedulername of a pod. So i change the validating codes in the file of validation.go. And i created a second scheduler named kube-scheduler-test. That is pod whose schedulername is kube-scheduler-test When i created a new pod whose schedulername is kube-scheduler-test, then the kube-scheduler-test will update the schedulername of pod to default-scheduler. And then default-scheduler will schedule this pod to specified node.
Could you explain why only some fields of a pod can be modified and whether my method of changing the schedulername acceptable or not?
Pods are designed to be disposable, think of them as immutable. When you want to change anything about a Pod, you create a new Pod, and throw away the old Pod.
There are many articles explaining immutable infrastructure.