### Create a manifest ```shell cat << EOF | kubectl create -f - apiVersion: extensions/v1beta1 kind: Deployment metadata: annotations: labels: k8s-app: tectonic-test-operator managed-by-test-operator: "true" name: tectonic-test-operator namespace: tectonic-system spec: replicas: 1 selector: matchLabels: k8s-app: tectonic-test-operator strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 1 type: RollingUpdate template: metadata: labels: k8s-app: tectonic-test-operator tectonic-app-version-name: tectonic-cluster pod-anti-affinity: test-operator-01 spec: affinity: podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchLabels: pod-anti-affinity: test-operator-01 topologyKey: kubernetes.io/hostname containers: - env: - name: CLUSTER_ID valueFrom: configMapKeyRef: key: clusterID name: tectonic-config image: busybox imagePullPolicy: IfNotPresent name: tectonic-test-operator command: - sleep - "1000" resources: limits: cpu: 20m memory: 50Mi requests: cpu: 20m memory: 50Mi terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: - mountPath: /etc/ssl/certs name: certs dnsPolicy: ClusterFirst imagePullSecrets: - name: coreos-pull-secret restartPolicy: Always schedulerName: default-scheduler securityContext: runAsNonRoot: true runAsUser: 65534 terminationGracePeriodSeconds: 30 volumes: - hostPath: path: /usr/share/ca-certificates name: certs EOF ``` ### Patch the anti-affinity ```shell kubectl patch deployment tectonic-test-operator -n tectonic-system -p '{"spec":{"template":{"metadata":{"labels":{"pod-anti-affinity":"test-operator-02"}},"spec":{"affinity":{"podAntiAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":[{"labelSelector":{"matchLabels":{"pod-anti-affinity":"test-operator-02"}},"topologyKey":"kubernetes.io/hostname"}]}}}}}}' ```