Reputation: 923
I am looking to implement "PodNodeSelector" in GKE. I want to divide my worker node into groups of performance, stage and production Namespace. I am not using nodeselector (node affinity) or taints/toleration, as I want to use same deployment template files for each environment.
worker1/2 -> Namespace perf
worker 3/4 -> Namespace stage
worker 5/6 -> Namespace prod
I can implement this in normal k8s cluster using "PodNodeSelector" but I am not able to figure it out in gke.
Upvotes: 0
Views: 954
Reputation: 2746
As @Wojtek_B already mentioned in his answer - PodNodeSelector is not available on GKE. However, I have just open sourced a mutating webhook that does allow you to achieve the same results by allowing you to add node affinity on a namespace level (it's even a bit more flexible, imo:). It is called namespace-node-affinity and is available on GitHub.
PS: PodNodeSelector is not available on EKS either, so the mutating webhook is a solution there too :)
Upvotes: 1
Reputation: 4443
This feature is not included in GKE since it's a managed version of Kubernetes and the admission controllers for that feature aren't enabled.
What you can do is to create a Feature Request using issue tracker and let the product team know that you'd like to have that feature available.
As the most feasible alternitive, you can use taint or affinity (which you don't want) or create your own cluster in GCE.
Upvotes: 0