---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: cde-splitpdf
  namespace: cde
  labels:
    app: cde-splitpdf
    service: cde-splitpdf
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cde-splitpdf
  template:
    metadata:
      labels:
        app: cde-splitpdf
        service: cde-splitpdf
      annotations:
        traffic.sidecar.istio.io/excludeOutboundPorts: "8200"
        vault.hashicorp.com/agent-init-first: "true"
        vault.hashicorp.com/agent-inject: "true"
        vault.hashicorp.com/agent-pre-populate-only: "true"
        vault.hashicorp.com/auth-path: auth/kubernetes
        vault.hashicorp.com/role: cde
        vault.hashicorp.com/agent-inject-secret-cde-env: secrets/data/vault/apps/cde
        vault.hashicorp.com/agent-inject-template-cde-env: |-
          {{- with secret "secrets/data/vault/apps/cde" -}}
          {{- range $k, $v := .Data.data }}
          export {{ $k }}=$(printf '%b' {{ printf "%q" (printf "%v" $v) }})
          {{- end }}
          {{- end -}}
    spec:
      serviceAccountName: cde-vault
      containers:
        - name: cde-splitpdf
          image: cr.yandex/crp3ccidau046kdj8g9q/splitpdf-worker:prod_9f3c1d2a
          imagePullPolicy: IfNotPresent
          command:
            - /bin/bash
            - -lc
          args:
            - |
              set -e
              source /vault/secrets/cde-env
              exec /worker
          ports:
            - name: http
              containerPort: 8000
              protocol: TCP
          env:
            - name: S3_IS_CONTOUR
              value: "true"
          resources:
            requests:
              cpu: "25m"
              memory: 128Mi
      imagePullSecrets:
        - name: regcred
