apiVersion: apps/v1
kind: Deployment
metadata:
  name: sdx-deliver
  labels:
    app: sdx-deliver
spec:
  replicas: 1
  selector:
    matchLabels:
      app: sdx-deliver
  template:
    metadata:
      labels:
        app: sdx-deliver
    spec:
      containers:
      - image: eu.gcr.io/{{ .Values.registry_location }}/sdx-deliver:{{ .Chart.AppVersion }}
        imagePullPolicy: Always
        name: sdx-deliver
        resources:
          requests:
            cpu: "250m"
            memory: "512Mi"
          limits:
            cpu: "250m"
            memory: "512Mi"
        env:
          - name: PROJECT_ID
            valueFrom:
              configMapKeyRef:
                name: sdx-config
                key: project_id
          - name: LOGGING_LEVEL
            valueFrom:
              configMapKeyRef:
                name: sdx-config
                key: logging_level
          - name: DATA_SENSITIVITY
            valueFrom:
              configMapKeyRef:
                name: sdx-config
                key: data_sensitivity
          - name: DATA_RECIPIENT
            valueFrom:
              configMapKeyRef:
                name: sdx-config
                key: data_recipient
        livenessProbe:
          httpGet:
            path: /healthcheck
            port: 5000
          initialDelaySeconds: 30
          timeoutSeconds: 10
          periodSeconds: 30
          failureThreshold: 3
      serviceAccountName: sdx-workload-identity
