kind: Deployment
apiVersion: apps/v1
metadata:
  name: terraform-ingress-controller
  labels:
    k8s-app: terraform-ingress-controller
spec:
  replicas: 1 # should not be more than one, even during the rolling update
  selector:
    matchLabels:
      k8s-app: terraform-ingress-controller
  template:
    metadata:
      labels:
        k8s-app: terraform-ingress-controller
    spec:
      serviceAccountName: terraform-ingress-controller
      tolerations:
        - effect: NoSchedule # Make sure the pod can be scheduled on master kubelet.
          operator: Exists
        - key: CriticalAddonsOnly # Mark the pod as a critical add-on for rescheduling.
          operator: Exists
        - effect: NoExecute
          operator: Exists
      containers:
        - name: terraform-ingress-controller
          image: kayrus/ingress-terraform:0.0.3
          imagePullPolicy: Always
          args:
            - /bin/terraform-ingress-controller
            - --config=/etc/config/terraform-ingress-controller-config.yaml
          volumeMounts:
            - name: ingress-config
              mountPath: /etc/config
      volumes:
        - name: ingress-config
          configMap:
            name: terraform-ingress-controller-config
            items:
              - key: config
                path: terraform-ingress-controller-config.yaml
