---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: pdf-markings-amqp
  namespace: documentations
  labels:
    app: pdf-markings-amqp
    k8slens-edit-resource-version: v1
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: pdf-markings-amqp
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: pdf-markings-amqp
    spec:
      containers:
      - env:
        - name: VERIFY
          value: 'False'
        - name: MARKS_APP__LOG_LEVEL
          value: INFO
        - name: HTTP_PORT
          value: '8000'
        - name: MARKS_DOCUMENTS_DB__HOST
          value: postgres-service
        - name: MARKS_DOCUMENTS_DB__PORT
          value: '5432'
        - name: MARKS_DOCUMENTS_DB__DATABASE
          value: documentations
        - name: DOC_POSTGRES_POOL_SIZE
          value: '10'
        - name: MARKS_DOCUMENTS_DB__SSLMODE
          value: disable
        - name: API_ADDRESS
          value: 0.0.0.0:8000
        - name: DATABASE_SSL_MODE
          value: disable
        - name: MARKS_S3__USE_SSL
          value: 'false'
        - name: MARKS_S3__SSL_VERIFY
          value: 'false'
        - name: MARKS_S3__DEFAULT_BUCKET
          value: documentations-2-donstroi
        - name: ENVIRONMENT
          value: production
        - name: YANDEX_S3_ACCOUNT_PATH
          value: /etc/sarex/yc-s3-storage/yc-s3-service-account.json
        - name: MARKS_QR__REDIRECT_URL
          value: https://stamp-verification.sarex.dsinv.ru/
        - name: MARKS_QR__BASE_DOCUMENT_URL
          value: https://sarex.dsinv.ru
        - name: MARKS_RABBITMQ__ROUTING__INPUT_QUEUE
          value: pdf_markings_input
        - name: MARKS_S3__REGION
          value: ru-central1
        - name: MARKS_CRYPTO__HASHING_ALGO
          value: md_gost12_256
        - name: MARKS_DOCUMENTS_DB__USERNAME
          valueFrom:
            secretKeyRef:
              key: username
              name: postgres-secret
        - name: MARKS_DOCUMENTS_DB__PASSWORD
          valueFrom:
            secretKeyRef:
              key: password
              name: postgres-secret
        - name: MARKS_S3__URL
          valueFrom:
            secretKeyRef:
              key: endpoint_url
              name: yc-s3
        - name: MARKS_S3__ACCESS_KEY
          valueFrom:
            secretKeyRef:
              key: key_id
              name: yc-s3
        - name: MARKS_S3__SECRET_KEY
          valueFrom:
            secretKeyRef:
              key: access_key
              name: yc-s3
        - name: MARKS_RABBITMQ__HOST
          valueFrom:
            secretKeyRef:
              key: host
              name: rabbitmq
        - name: MARKS_RABBITMQ__PORT
          valueFrom:
            secretKeyRef:
              key: port
              name: rabbitmq
        - name: MARKS_RABBITMQ__USERNAME
          valueFrom:
            secretKeyRef:
              key: username
              name: rabbitmq
        - name: MARKS_RABBITMQ__PASSWORD
          valueFrom:
            secretKeyRef:
              key: password
              name: rabbitmq
        - name: MARKS_RABBITMQ__VHOST
          valueFrom:
            secretKeyRef:
              key: vhost
              name: rabbitmq
        - name: MARKS_RABBITMQ__HEARTBEAT_SECONDS
          valueFrom:
            secretKeyRef:
              key: heartbeat
              name: rabbitmq
        image: cr.yandex/crp3ccidau046kdj8g9q/pdf-markings-amqp:prod_84d12e68
        imagePullPolicy: IfNotPresent
        name: pdf-markings-amqp
        ports:
        - containerPort: 8000
          name: http
          protocol: TCP
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /etc/sarex/yc-s3-storage
          name: yc-s3
          readOnly: true
      dnsPolicy: ClusterFirst
      imagePullSecrets:
      - name: dockerhub
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
      volumes:
      - name: yc-s3
        secret:
          defaultMode: 420
          secretName: documentations-yc-s3
