apiVersion: apps/v1
kind: Deployment
metadata:
  name: ippac
  namespace: kube-ippac
spec:
  selector:
    matchLabels:
      app: ippac
  replicas: 2
  template:
    metadata:
      labels:
        app: ippac
    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: app
                operator: In
                values:
                - ippac
            topologyKey: kubernetes.io/hostname
      containers:
        - name: ippac
          image: quay.io/ooichman/ippac:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 8443
          env:
          - name: CERT_FILE
            value: '/etc/certs/cert.pem'
          - name: KEYFILE
            value: '/etc/certs/key.pem'
          - name: PORT 
            value: '8443'
          volumeMounts:
          - name: ippac-certs
            mountPath: /etc/certs
            readOnly: true
      volumes:
      - name: ippac-certs
        secret:
          secretName: ippac-tls
