apiVersion: apps/v1
kind: Deployment
metadata:
  name: peer2
spec:
  replicas: 1
  selector:
    matchLabels:
      name: peer2
  template:
    metadata:
      labels:
        name: peer2
        has-mbpu: "true"
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: node
                    operator: In
                    values:
                      - worker1
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                - key: has-mbpu
                  operator: In
                  values:
                    - "true"
              topologyKey: "kubernetes.io/hostname"
      containers:
        - name: peer2
          image: alpine