Default node selector

3/28/2019

Use case

Let's say I've got 3 different node pools: default, kafka and team-a. I want to make sure that only kafka relevant deployments and stuff like daemonsets or kubernetes system services run on this node pool. I do so by simply adding a node selector to my kafka deployments, so that it can only be scheduled on the kafka nodepool:

nodeSelector:
  cloud.google.com/gke-nodepool: kafka

The problem

When I have further deployments or statefulsets which do not have any node selector specified they might get scheduled on that kafka nodepool. Instead I want all other deployments without nodeselector to be scheduled inside of my default nodepool.

Worded as generic question

How can I make sure that all deployments & statefulsets without a node selector will be scheduled inside of a specific nodepool?

-- kentor
google-kubernetes-engine
kubernetes

1 Answer

3/28/2019
-- Akash Sharma
Source: StackOverflow