Can someone please review this. I am getting this error everytime and unable to . . .

Mayur Sharma:
Can someone please review this. I am getting this error everytime and unable to find the missing point. Though deployment and pod are runnign good on master node

Tej_Singh_Rana:
Hello, @Mayur Sharma
I checked the question and there is no information to use affinity.

Mayur Sharma:
Hi @Tej_Singh_Rana, thanks for the response.

Two things, please help me with following doubts,

  1. Question does not mention to use nodeSelector. So, why it is looking specifically for nodeSelector.
  2. Also, I read somewhere that we should avoid use of nodeSelector and use nodeAffinity in case of scheduling the pod on specific node.
    Can you please highlight when to use when.

Mayur Sharma:
@Tej_Singh_Rana: I tried with nodeSelector and tolerations. and it worked. Let me know about the above queries only

Thanks once again



Mayur Sharma:
Hi @Tej_Singh_Rana May I ask for your help here also and clear the doubt. Thanks

Tej_Singh_Rana:
Sorry for late, response…
> Also, I read somewhere that we should avoid use of nodeSelector and use nodeAffinity in case of scheduling the pod on specific node.
Yeah, it is. but it’s about time.
We have to perform a task within a couple of mins to manage the time. You already know the node Affinity template, how complex it is.

Tej_Singh_Rana:
If in the question, they specifically talk about labels and give a description like schedule a pod with help of node labels then you can choose nodeSelector. It’s up to you.

Tej_Singh_Rana:
For the exam perspective, we don’t need to do extra things, which can create a problem in the exam and will consume a lot of time to troubleshoot.

Tej_Singh_Rana:
> Question does not mention to use nodeSelector. So, why it is looking specifically for nodeSelector.
We can use nodeName field, we don’t need tolerations if we use this.
For nodeSelector , we also require tolerations that will consume more time.

Mayur Sharma:
@Tej_Singh_Rana Thanks for the response. I understand the point of saving the time.

but you confused me with last statement
> “We can use nodeName field, we don’t need tolerations if we use this.”
nodeName will select the node, but if we have taints on the node then we should use tolerations . Please correct me if I am wrong.

Thanks

Tej_Singh_Rana:
Hello, @Mayur Sharma
If you add nodeName field in the pod specs then we don’t need to add tolerations.
Reference:
https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename

Mayur Sharma:
Thanks @Tej_Singh_Rana for the clarification.