apiVersion: apps/v1 kind: Deployment metadata: labels: app: sarex-subscriptions name: sarex-subscriptions namespace: subscriptions spec: replicas: 1 selector: matchLabels: app: sarex-subscriptions template: metadata: annotations: traffic.sidecar.istio.io/excludeOutboundPorts: '8200' vault.hashicorp.com/agent-init-first: 'true' vault.hashicorp.com/agent-inject: 'true' vault.hashicorp.com/agent-inject-secret-subscriptions-minio: secrets/data/minio/apps/subscriptions vault.hashicorp.com/agent-inject-secret-subscriptions-postgresql: secrets/data/apps/subscriptions/postgres vault.hashicorp.com/agent-inject-template-subscriptions-minio: |- {{- with secret "secrets/data/minio/apps/subscriptions" -}} YC_S3_ACCESS_KEY_ID={{ or (index .Data.data "access_key") (index .Data.data "access_key_id") }} YC_S3_SECRET_ACCESS_KEY={{ or (index .Data.data "secret_key") (index .Data.data "secret_access_key") }} YC_S3_BUCKET_NAME=subscriptions YC_S3_ENDPOINT_URL=https://minio.storage.svc.cluster.local {{- end -}} vault.hashicorp.com/agent-inject-template-subscriptions-postgresql: |- {{- with secret "secrets/data/apps/subscriptions/postgres" -}} DATABASE_HOST={{ index .Data.data "host" }} DATABASE_PORT={{ index .Data.data "port" }} DATABASE_NAME={{ index .Data.data "database" }} DATABASE_USER={{ index .Data.data "username" }} DATABASE_PASSWORD={{ index .Data.data "password" }} {{- end -}} vault.hashicorp.com/agent-pre-populate-only: 'true' vault.hashicorp.com/auth-path: auth/kubernetes vault.hashicorp.com/role: subscriptions labels: app: sarex-subscriptions spec: nodeSelector: dedicated: backend tolerations: - key: dedicated operator: Equal value: backend effect: NoSchedule containers: - args: - | set -a [ -f /vault/secrets/subscriptions-postgresql ] && . /vault/secrets/subscriptions-postgresql [ -f /vault/secrets/subscriptions-minio ] && . /vault/secrets/subscriptions-minio set +a exec /server/entrypoint.sh command: - /bin/sh - -ec env: - name: API_ADDRESS value: '8000' - name: SYSTEM_LOG_HOST value: http://sarex.stand.sarex.tech - name: USER_SERVICE_HOST value: http://backend.django.svc.cluster.local:8000 - name: IS_USE_TELEGRAM value: 'false' - name: IS_MAILGUN_USE value: '0' - name: SMTP_EMAIL_FROM value: noreply@stand.sarex.tech - name: SMTP_EMAIL_HOST value: mail.stand.sarex.tech - name: SMTP_EMAIL_PORT value: '465' image: cr.yandex/crp3ccidau046kdj8g9q/subscriptions:latest imagePullPolicy: IfNotPresent name: subscriptions ports: - containerPort: 8000 name: http protocol: TCP resources: requests: cpu: 25m memory: 128Mi imagePullSecrets: - name: regcred serviceAccountName: subscriptions-vault