160 lines
5.7 KiB
YAML
160 lines
5.7 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: inspections-backend
|
|
labels:
|
|
app: inspections-backend
|
|
service: backend
|
|
namespace: inspections
|
|
spec:
|
|
replicas: 1
|
|
revisionHistoryLimit: 10
|
|
selector:
|
|
matchLabels:
|
|
app: inspections-backend
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: inspections-backend
|
|
service: backend
|
|
annotations:
|
|
proxy.istio.io/config: |
|
|
tracing:
|
|
sampling: 100
|
|
zipkin:
|
|
address: signoz-otel-collector-external.signoz.svc.cluster.local:9411
|
|
custom_tags:
|
|
k8s.pod.name:
|
|
environment:
|
|
name: POD_NAME
|
|
k8s.namespace.name:
|
|
environment:
|
|
name: POD_NAMESPACE
|
|
k8s.pod.ip:
|
|
environment:
|
|
name: INSTANCE_IP
|
|
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-inspections-db: secrets/data/apps/inspections/postgres
|
|
vault.hashicorp.com/agent-inject-secret-inspections-django-auth: secrets/data/vault/common/django_auth
|
|
vault.hashicorp.com/agent-inject-secret-inspections-kafka: secrets/data/kafka/apps/inspections
|
|
vault.hashicorp.com/agent-inject-template-inspections-db: |-
|
|
{{- with secret "secrets/data/apps/inspections/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-inject-template-inspections-django-auth: |-
|
|
{{- with secret "secrets/data/vault/common/django_auth" -}}
|
|
SAREX_BACKEND_AUTH={{ index .Data.data "key" }}
|
|
{{- end -}}
|
|
vault.hashicorp.com/agent-inject-template-inspections-kafka: |-
|
|
{{- with secret "secrets/data/kafka/apps/inspections" -}}
|
|
KAFKA_HOST={{ with index .Data.data "auth" }}{{ index . "bootstrap_servers" }}{{ else }}{{ index .Data.data "bootstrap_servers" }}{{ end }}
|
|
KAFKA_USERNAME={{ index .Data.data "username" }}
|
|
KAFKA_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: inspections
|
|
spec:
|
|
serviceAccountName: inspections-vault
|
|
imagePullSecrets:
|
|
- name: regcred
|
|
nodeSelector:
|
|
dedicated: backend
|
|
tolerations:
|
|
- key: dedicated
|
|
operator: Equal
|
|
value: backend
|
|
effect: NoSchedule
|
|
containers:
|
|
- name: backend
|
|
image: cr.yandex/crp3ccidau046kdj8g9q/inspections-backend:latest
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- /bin/bash
|
|
- -ec
|
|
args:
|
|
- |
|
|
set -a
|
|
[ -f /vault/secrets/inspections-db ] && . /vault/secrets/inspections-db
|
|
[ -f /vault/secrets/inspections-kafka ] && . /vault/secrets/inspections-kafka
|
|
[ -f /vault/secrets/inspections-django-auth ] && . /vault/secrets/inspections-django-auth
|
|
set +a
|
|
exec ./entrypoint.sh
|
|
ports:
|
|
- name: http
|
|
containerPort: 8000
|
|
protocol: TCP
|
|
env:
|
|
- name: K8S_POD_UID
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.uid
|
|
- name: K8S_POD_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.name
|
|
- name: K8S_NAMESPACE
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|
|
- name: OTEL_RESOURCE_ATTRIBUTES
|
|
value: k8s.pod.uid=$(K8S_POD_UID),k8s.pod.name=$(K8S_POD_NAME),k8s.namespace.name=$(K8S_NAMESPACE)
|
|
- name: DEBUG
|
|
value: 'false'
|
|
- name: SERVICE_URL
|
|
value: https://sarex.stand.sarex.tech
|
|
- name: HTTP_APP_HOST
|
|
value: 0.0.0.0
|
|
- name: HTTP_APP_PORT
|
|
value: '8000'
|
|
- name: HTTP_APP_ROOT_PATH
|
|
value: /inspections
|
|
- name: HTTP_APP_WORKERS
|
|
value: '3'
|
|
- name: HTTP_APP_ADMIN_ENABLE
|
|
value: 'true'
|
|
- name: KAFKA_SSL_CAFILE
|
|
value: /usr/local/share/ca-certificates/Yandex/YandexInternalRootCA.crt
|
|
- name: KAFKA_EAV_ASSETS_TOPIC
|
|
value: assets_broadcast
|
|
- name: JWT_AUTH_ENABLE
|
|
value: 'true'
|
|
- name: NOTIFICATIONS_ENABLE
|
|
value: 'true'
|
|
- name: NOTIFICATIONS_EMAIL_FROM
|
|
value: hello@sarex.stand.sarex.tech
|
|
- name: SAREX_BACKEND_URL
|
|
value: http://backend-svc.django.svc.cluster.local
|
|
- name: SAREX_BACKEND_TIMEOUT
|
|
value: '30'
|
|
- name: EAV_URL
|
|
value: http://backend-svc.eav.svc.cluster.local:80
|
|
- name: EAV_TIMEOUT
|
|
value: '30'
|
|
- name: WORKFLOWS_URL
|
|
value: http://backend-svc.processing.svc.cluster.local:80
|
|
- name: WORKFLOWS_TIMEOUT
|
|
value: '30'
|
|
- name: WORKFLOWS_EMAIL_DOCKER_IMAGE
|
|
value: cr.yandex/crp3ccidau046kdj8g9q/notification:email
|
|
- name: MOBILE_APP_CURRENT_VERSION
|
|
value: 1.0.0
|
|
- name: MOBILE_APP_RECOMMENDED_VERSION
|
|
value: 1.0.0
|
|
- name: MOBILE_APP_REQUIRED_VERSION
|
|
value: 1.0.0
|
|
- name: MAILER_URL
|
|
value: http://sarex.stand.sarex.tech:8000
|
|
- name: MAILER_TIMEOUT
|
|
value: '30'
|
|
resources:
|
|
requests:
|
|
memory: 128Mi
|
|
cpu: 25m
|