---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: zdt
spec:
  replicas: 2
  selector:
    matchLabels:
      role: app
  template:
    metadata:
      labels:
        role: app
    spec:
      containers:
        - name: app
          image: alexandreroman/k8s-zdt-demo:v1
          ports:
            - containerPort: 8080
              name: http
          livenessProbe:
            httpGet:
              port: http
              path: /actuator/health/liveness
            initialDelaySeconds: 30
          readinessProbe:
            httpGet:
              port: http
              path: /actuator/health/readiness
            initialDelaySeconds: 10
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                  - key: role
                    operator: In
                    values:
                      - app
              topologyKey: kubernetes.io/hostname
