Kubernetes

Create a deployment with the following properties:

Difficulty: unrated

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

Answer

kubectl create deployment blufer --image=python --replicas=3 -o yaml --dry-run=client > deployment.yaml

Add the following section (vi deployment.yaml):

spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedlingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: blufer
            operator: Exists

kubectl apply -f deployment.yaml