apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/instance: dev-empi-db-sync
  name: csi-empi-db-sync
  namespace: csi-perf
spec:
  replicas: 2
  selector:
    matchLabels:
      app: csi-empi-db-sync
      tier: backend
      track: stable
  template:
    metadata:
      labels:
        app: csi-empi-db-sync
        module: empi
        tier: backend
        track: stable
    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
               - key: app
                 operator: In
                 values:
                 - csi-empi-db-sync
            topologyKey: "kubernetes.io/hostname"
      containers:
        - env:
            - name: hostname
              value: csi-empi-db-sync
          envFrom:
            - configMapRef:
                name: service-configs-empi-db-sync
            - configMapRef:
                name: service-configs
          image: registry.cloudsolutions.com.sa/vida-qa/empi-db-sync:4.0.0.2
          name: csi-empi-db-sync
          # livenessProbe:
          #   httpGet:
          #     path: /api/actuator/health
          #     port: http
          #   initialDelaySeconds: 800
          #   failureThreshold: 3
          #   timeoutSeconds: 10
          # readinessProbe:
          #   httpGet:
          #     path: /api/actuator/health
          #     port: http
          #   initialDelaySeconds: 20
          #   failureThreshold: 3
          #   timeoutSeconds: 10          
          ports:
            - containerPort: 3080
              name: http
          resources:
            limits:
              memory: 1Gi
            requests:
              cpu: 100m
              memory: 512Mi
      imagePullSecrets:
        - name: regcred