Rahul:
@Mohamed Ayman or anyone here who can help for below discussion -
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
MAyman [10:52 PM]
Yes if you delete the line of setting nodename:master the pod will be running normally
MAyman [11:36 PM]
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 [1:06 PM]
@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 [9:07 AM]
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 (edited)