apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    description: Vault Api Worker
  labels:
    app: vault-api-worker
    environment: Development
    tier: Service
  name: vault-api-worker
  namespace: sirius
spec:
  revisionHistoryLimit: 1
  minReadySeconds: 10
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 1
  replicas: 1
  selector:
    matchLabels:
      app: vault-api-worker
  template:
    metadata:
      labels:
        app: vault-api-worker
      name: vault-api-worker
    spec:
      containers:
        - name: vault-api-worker
          image: docker.io/swisschains/sirius-vault-api-worker:1.1.0
          imagePullPolicy: Always
          lifecycle:
            postStart:
              exec:
                command:
                  - /bin/sh
                  - -c
                  - "/bin/echo 'options single-request-reopen' >> /etc/resolv.conf"
          ports:
            - containerPort: 5000
          readinessProbe:
            httpGet:
              path: /api/isalive
              port: 5000
            initialDelaySeconds: 40
            periodSeconds: 10
          livenessProbe:
            httpGet:
              path: /api/isalive
              port: 5000
            initialDelaySeconds: 40
            periodSeconds: 20
          resources:
            requests:
              memory: 64Mi
              cpu: 40m
            limits:
              memory: 128Mi
              cpu: 500m
          env:
            - name: RemoteSettingsUrls__0
              value: "http://settings.sirius.svc.cluster.local/common"
            - name: RemoteSettingsUrls__1
              value: "http://settings.sirius.svc.cluster.local/sirius/common"
            - name: RemoteSettingsUrls__2
              value: "http://settings.sirius.svc.cluster.local/sirius/vault-api"
      tolerations:
       - effect: NoSchedule
         operator: Exists
      nodeSelector:
        agentpool: sirius