apiVersion: apps/v1
kind: Deployment
metadata:
  name: pod-to-b-multi-node-headless
spec:
  selector:
    matchLabels:
      name: pod-to-b-multi-node-headless
  replicas: 1
  template:
    metadata:
      labels:
        name: pod-to-b-multi-node-headless
    spec:
      containers:
      - name: pod-to-b-multi-node-container
        image: docker.io/byrnedo/alpine-curl:0.1.8
        command: ["/bin/ash", "-c", "sleep 1000000000"]
        imagePullPolicy: IfNotPresent
        livenessProbe:
          exec:
            command: ["curl", "-sS", "-o", "/dev/null", "echo-b-headless"]
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: name
                operator: In
                values:
                - echo-b
            topologyKey: "kubernetes.io/hostname"
