<p>While reading nodeselector (<a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#:%7E:text=nodeSelector" rel="nofollow noreferrer">link</a>), I was bewildered why node selector is a key-value pair. It would have been simple if just provide an identifier. For example instead of following</p>
<pre><code>kubectl label nodes node.xyz disktype=ssd
</code></pre>
<p>We could use</p>
<pre><code>kubectl label nodes node.xyz ssdDisk
</code></pre>
<p>What is the reason for giving nodeselector as key value pair.</p>

Manish Khandelwal
<p>I am not sure I am right or wrong but let's say we have added two different nodes with different labels (disktype=ssd and disktype=hsd).
So if we have a key-value pair then it is easy for us to place a pod on a particular node (for example  diskctype=ssd node).
<a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/</a></p>
<p>We can say it is there to separate the nodes and easily select the required node in between two nodes.</p>
<p>example:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: nginx
  labels:
    env: test
spec:
  containers:
  - name: nginx
    image: nginx
    imagePullPolicy: IfNotPresent
  nodeSelector:
    disktype: ssd
</code></pre>
<p>Please excuse me if I missed something.</p>
