As per the kubernetes documents, requiredDuringSchedulingRequiredDuringExecution
is still not implemented. But I see some post that it been used. We have a need to use it, so does it works in GCE?
Currently, we using requiredDuringSchedulingIgnoredDuringExecution
, but sometimes it causes one of the pod in pending state as they cannot be on the same node due to resource crunch. We need both pods on same nodes so they can share SSD. Earlier, we tried with nfs
but nfs
is way slower than using local ssd
. Based on our need, we want kubernetes to create a new node and have those two pods install in it instead of sitting in pending
state.
If one of the pods cannot be assigned to the node due to limited resources on the node, then I would suggest increasing the resources within the node pool.
Features offered by Kubernetes are based on versions. If you are using a version of Kubernetes that offers Inter-pod affinity and anti-affinity, then it will be available within GKE. One of the only limitations when using GKE is that you cannot make changes to the Master node as it is a managed service. If you have built your own Cluster within GCE, this limitation does not apply.
If the pods are labeled to be assigned to a specific node, but can't due to other pods being scheduled to it, you could also use taints. Taints are the opposite of node affinity where a taint will repel pods from being scheduled to a specific node.