The extention of updateable fields in Pod

59 views
Skip to first unread message

hou dong

unread,
Sep 25, 2021, 10:42:16 PMSep 25
to Kubernetes developer/contributor discussion
I wonder why only some fields of a pod can be modified。
The updateable fields are:
  • spec.containers[*].image
  • spec.initContainers[*].image
  • spec.activeDeadlineSeconds

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.
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?
Thanks a lot!


Daniel Smith

unread,
Sep 27, 2021, 11:42:49 AMSep 27
to hou dong, Kubernetes developer/contributor discussion
If you want to decide which scheduler should handle a pod, the most expedient way to do that is to make an admission webhook which decides.

If we permitted that field to change, it would cause races in all existing schedulers, which don't expect pods to be taken away from them, meaning it would be unpredictable which scheduler actually acted on the pod.

Your intention of handing a pod off to another scheduler wouldn't have that problem, but we can't guarantee people would use the ability only for that.

Would this actually be a big deal? IMO, not really, but there's an extremely high bar for changing pods, so at a minimum we'd need to know why the webhook approach doesn't work for you.

--
You received this message because you are subscribed to the Google Groups "Kubernetes developer/contributor discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/9fef38d8-e920-4e84-b951-18b8d7c267bbn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages