Hi all, May be simple one, I'm getting confused between node affinity vs node s . . .

karthi Mahadev:
Hi all,
May be simple one, I’m getting confused between node affinity vs node selector . How to make this run only on Controlplane ?

Create a redis deployment with the following parameters:
Name of the deployment should be redis using the redis:alpine image. It should have exactly 1 replica.
The container should request for .2 CPU. It should use the label app=redis.
Make sure that the pod is scheduled on master/controlplane node.

chris resnik:
https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/

chris resnik:
search for “nodename”

karthi Mahadev:
ah…

karthi Mahadev:

spec:
  containers:
  - name: nginx
    image: nginx
  nodeName: kube-01

Rahul:
@karthi Mahadev You can use nodeName as specified in solution
Otherwise you can add toleration with node affinity since toleration alone would not guarantee pod placement on expected node