What is the most correct way to place pods in a specific node? `nodeSelector` or . . .

Vishwa Seneviratne:
What is the most correct way to place pods in a specific node? nodeSelector or nodeName? Which one should I use if it comes in the exam?

Sunil Sharma:
I feel nodeName is the fastest one but as per documentation nodeSelector is the recommended one

Frankube:
nodeSelector It has more info to make pod placement more selective, while nodeName it is typically used for placements without special requirements or if the pod scheduler is not working

Vishwa Seneviratne:
So, using either should be valid. Thanks fellas

Pratik Patel:
To use nodeselector, the node must have label, for nodeName, it doesn’t.

Vishwa Seneviratne:
Thank you