K8S Node Selectors

Node Selectors are used to place K8S PodK8S Pod
Pod is a [[K8S Object]] used to run one or more tightly coupled containers and is rarely used directly, especially in production because of the limitations on the number of properties that can be u...
s on specific K8S NodeK8S Node
In [[Kubernetes]], a Node is a (physical or virtual) machine in charge of running some workloads. Kubernetes is run entirely on nodes, and everything that happens on Kubernetes cluster, happens on ...
by label. For more complex placement options, see K8S Node AffinityK8S Node Affinity
Node Affinity is a feature which ensures that [[K8S Pod]] end up running on specific [[K8S Node]]. We are already able to do this with [[K8S Node Selectors]], but with big limitations.

See also [[...
.

It's possible to make a pod go to a specific node based on the node label. For example, if you have one large node and two smaller nodes, and you have a workload which needs to run on the large node, you can make it run there by specifying:


apiVersion: v1
kind: Pod
metadata:
  name: some-pod
spec:
  containers:
    - name: some-name
      image: some-image
  nodeSelector:
    size: Large


In order for this to work, we need to label the large node with size: Large. We can do this by running:

kubectl label nodes <node-name> <label-key>=<label-value>

Status: #🌲