Kubernetes

Using node affinity, set a Pod to schedule on a node where the key is "region" and value is either "asia" or "emea"

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

vi pod.yaml

affinity:
  nodeAffinity:
    requiredDuringSchedlingIgnoredDuringExecution:
      nodeSelectorTerms:
      - matchExpressions:
        - key: region
          operator: In
          values:
          - asia
          - emea