<p>I was going through Kubernetes documentation for node affinity and match expression under it. Among other operators it listed Gt and Lt (which I think is abbreviation for Greater than and less than respectively). I was thinking about how can I use them or what could be valid use cases for them but could not think of any.</p>
<p>Can you tell what are the possible use cases for Gt and Lt to be used in node affinity and how will I use them.</p>

Bagira
<p><strong>values</strong> in <strong>matchExpressions</strong> is an array of string. If you use Gt or Lt as the <strong>operator</strong>, the <strong>values</strong> array must have a single element, which will be interpreted as an integer.</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: with-node-affinity
spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: kubernetes.io/e2e-az-numeric-value
            operator: Gt
            values:
            - 100
  containers:
  - name: with-node-affinity
    image: k8s.gcr.io/pause:2.0
</code></pre>
<p>The pod will run on a node if the node's label has a key <strong>kubernetes.io/e2e-az-numeric-value</strong> with value that is greater than <strong>100</strong>.</p>
