I have the following code for pod creation. I have two nodes one master and another node is worker node, I am creating two pods I need one pod to be scheduled on the master and the other pod on the worker node. I have not specified for pod second testing1 to be scheduled on a worker node because by default pods are scheduled on worker nodes. But the second pod testing1 is also scheduled on the master node.
Yaml file:
apiVersion: v1
kind: Pod
metadata:
name: test
labels:
app: test
spec:
containers:
- name: test
image: test:latest
command: ["sleep"]
args: ["infinity"]
imagePullPolicy: Never
ports:
- containerPort: 8080
nodeSelector:
node_type: master_node
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
kind: Pod
metadata:
name: testing1
labels:
app: testing1
spec:
containers:
- name: testing1
image: testing1:latest
command: ["sleep"]
args: ["infinity"]
imagePullPolicy: Never
Thanks help is highly appreciated in solving this issue.
Help is highly appreciated. Thanks