Is there any issue in setting *nodeName: master. This is question 4 lightning la . . .

Rahul:
Is there any issue in setting nodeName: master. This is question 4 lightning lab 2
This does not work for me

apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: my-busybox
name: my-busybox
namespace: dev2406
spec:
nodeName: master
volumes:
- name: secret-volume
secret:
secretName: dotfile-secret
containers:

  • args:
    • /bin/sh
    • -c
    • sleep 3600
      image: busybox
      name: secret
      volumeMounts:
    • name: secret-volume
      mountPath: /etc/secret-volume
      resources: {}
      dnsPolicy: ClusterFirst
      restartPolicy: Always

Mohamed Ayman:
Yes if you delete the line of setting nodename:master the pod will be running normally

Mohamed Ayman:
If you want to be able to schedule pods on the Kubernetes control-plane node, you need to remove a taint on the master nodes.
kubectl taint nodes --all http://node-role.kubernetes.io/master-|node-role.kubernetes.io/master-

Rahul:
@Mohamed Ayman How can I ensure the pod to run on master . Do we need to check for the taint always in exam ? Like if they say it to schedule on master, what should I use in YAML ?

Rahul:
controlplane $ k taint nodes --all http://node-role.kubernetes.io/master-|node-role.kubernetes.io/master-
node/controlplane untainted
error: taint “http://node-role.kubernetes.io/master|node-role.kubernetes.io/master” not found
@Mohamed Ayman How to ensure it running on master