181 lines
6.1 KiB
YAML
181 lines
6.1 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: backend
|
|
labels:
|
|
app: backend
|
|
service: backend
|
|
namespace: comparisons
|
|
spec:
|
|
replicas: 1
|
|
revisionHistoryLimit: 10
|
|
selector:
|
|
matchLabels:
|
|
app: backend
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: 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-comparisons-db: secrets/data/apps/comparisons/postgres
|
|
vault.hashicorp.com/agent-inject-secret-comparisons-jwt-public: secrets/data/vault/common/rsa_keys
|
|
vault.hashicorp.com/agent-inject-template-comparisons-db: |-
|
|
{{- with secret "secrets/data/apps/comparisons/postgres" -}}
|
|
DATABASE_HOST={{ index .Data.data "host" }}
|
|
DATABASE_PORT={{ index .Data.data "port" }}
|
|
DATABASE_DB={{ index .Data.data "database" }}
|
|
DATABASE_USER={{ index .Data.data "username" }}
|
|
DATABASE_PASSWORD={{ index .Data.data "password" }}
|
|
POSTGRES_ADDRESS={{ index .Data.data "host" }}
|
|
POSTGRES_PORT={{ index .Data.data "port" }}
|
|
POSTGRES_DB={{ index .Data.data "database" }}
|
|
POSTGRES_USER={{ index .Data.data "username" }}
|
|
POSTGRES_PASSWORD={{ index .Data.data "password" }}
|
|
{{- end -}}
|
|
vault.hashicorp.com/agent-inject-template-comparisons-jwt-public: |-
|
|
{{- with secret "secrets/data/vault/common/rsa_keys" -}}
|
|
{{ index .Data.data "public_key" }}
|
|
{{- end -}}
|
|
vault.hashicorp.com/agent-pre-populate-only: 'true'
|
|
vault.hashicorp.com/auth-path: auth/kubernetes
|
|
vault.hashicorp.com/role: comparisons
|
|
spec:
|
|
serviceAccountName: comparisons-vault
|
|
imagePullSecrets:
|
|
- name: regcred
|
|
nodeSelector:
|
|
dedicated: backend
|
|
tolerations:
|
|
- key: dedicated
|
|
operator: Equal
|
|
value: backend
|
|
effect: NoSchedule
|
|
containers:
|
|
- name: backend
|
|
image: cr.yandex/crp3ccidau046kdj8g9q/comparisons_backend_prod:latest
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- /bin/bash
|
|
- -ec
|
|
args:
|
|
- |
|
|
set -a
|
|
[ -f /vault/secrets/comparisons-db ] && . /vault/secrets/comparisons-db
|
|
[ -f /vault/secrets/comparisons-jwt-public ] && export AUTH_PUBLIC_KEY="$(cat /vault/secrets/comparisons-jwt-public)"
|
|
set +a
|
|
exec /app/entrypoint.sh
|
|
ports:
|
|
- name: http
|
|
containerPort: 8000
|
|
protocol: TCP
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /ping
|
|
port: 8000
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 60
|
|
timeoutSeconds: 1
|
|
successThreshold: 1
|
|
failureThreshold: 10
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /ping
|
|
port: 8000
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
timeoutSeconds: 1
|
|
successThreshold: 1
|
|
failureThreshold: 20
|
|
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: APP_NAME
|
|
value: comparisons
|
|
- name: APP_VERSION
|
|
value: 0.0.1
|
|
- name: LOGGER_LOG_LEVEL
|
|
value: info
|
|
- name: DATABASE_NAME
|
|
value: postgres
|
|
- name: ENABLE_SSL
|
|
value: 'false'
|
|
- name: POSTGRES_POOL_SIZE
|
|
value: '10'
|
|
- name: HTTP_PORT
|
|
value: '8000'
|
|
- name: DOCUMENTATIONS_INTERNAL_HOST
|
|
value: http://backend-api-svc.documentations.svc.cluster.local
|
|
- name: DOCUMENTATIONS_EXTERNAL_HOST
|
|
value: http://backend-api-svc.documentations.svc.cluster.local
|
|
- name: DOCUMENTATION_FILESTREAM_URL
|
|
value: http://backend-filestream-svc.documentations.svc.cluster.local/
|
|
- name: WORKFLOWS_HOST
|
|
value: http://backend-svc.processing.svc.cluster.local
|
|
- name: WORKFLOWS_IMAGE_VERSION
|
|
value: master
|
|
- name: WORKFLOWS_DJANGO_HOST
|
|
value: https://sarex.stand.sarex.tech
|
|
- name: WORKFLOWS_BIMV2_INTERNAL_HOST
|
|
value: http://backend-svc.bim.svc.cluster.local
|
|
- name: WORKSPACES_HOST
|
|
value: http://backend-svc.workspaces.svc.cluster.local
|
|
- name: EAV_HOST
|
|
value: http://backend-svc.eav.svc.cluster.local
|
|
- name: LAST_MASTER_BIM
|
|
value: '36311'
|
|
- name: LAST_SLAVE_1_BIM
|
|
value: '94015'
|
|
- name: LAST_SLAVE_2_BIM
|
|
value: '135771'
|
|
- name: ABAP_FIXED_CONC
|
|
value: '0'
|
|
- name: WORKFLOWS_CONFIG_FILEPATH
|
|
value: /etc/app/tasks-execution-config.json
|
|
volumeMounts:
|
|
- name: tasks-execution-config
|
|
mountPath: /etc/app/tasks-execution-config.json
|
|
subPath: tasks-execution-config.json
|
|
readOnly: true
|
|
resources:
|
|
requests:
|
|
memory: 100Mi
|
|
cpu: 25m
|
|
volumes:
|
|
- name: tasks-execution-config
|
|
configMap:
|
|
name: tasks-execution-config-comparisons-v2
|
|
items:
|
|
- key: tasks-execution-config-comparisons-v2.json
|
|
path: tasks-execution-config.json
|