116 lines
3.0 KiB
YAML
116 lines
3.0 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: backend
|
|
namespace: resources
|
|
labels:
|
|
app: backend
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: backend
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: backend
|
|
spec:
|
|
volumes:
|
|
- name: django-configmap
|
|
configMap:
|
|
name: django-configmap
|
|
items:
|
|
- key: production.py
|
|
path: production.py
|
|
defaultMode: 420
|
|
|
|
containers:
|
|
- name: backend
|
|
image: cr.yandex/crp3ccidau046kdj8g9q/sarex-resources:prod_d642ef88
|
|
imagePullPolicy: IfNotPresent
|
|
|
|
ports:
|
|
- name: http
|
|
containerPort: 8000
|
|
protocol: TCP
|
|
|
|
env:
|
|
- name: DJANGO_SETTINGS_MODULE
|
|
value: config.settings.production
|
|
- name: API_ADDRESS
|
|
value: "8000"
|
|
- name: DATABASE_NAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: database
|
|
name: postgresql-secret
|
|
- name: DATABASE_HOST
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: hostname
|
|
name: postgresql-secret
|
|
- name: DATABASE_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: username
|
|
name: postgresql-secret
|
|
- name: DATABASE_PORT
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: port
|
|
name: postgresql-secret
|
|
- name: DATABASE_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: password
|
|
name: postgresql-secret
|
|
- name: YC_S3_ACCESS_KEY_ID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: username
|
|
name: s3-secret
|
|
- name: YC_S3_ENDPOINT_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: host
|
|
name: s3-secret
|
|
- name: YC_S3_SECRET_ACCESS_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: password
|
|
name: s3-secret
|
|
- name: YC_S3_BUCKET_NAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: bucket
|
|
name: s3-secret
|
|
|
|
|
|
resources:
|
|
requests:
|
|
cpu: 100m
|
|
memory: 100Mi
|
|
|
|
volumeMounts:
|
|
- name: django-configmap
|
|
mountPath: /server/config/settings/production.py
|
|
subPath: production.py
|
|
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /ping
|
|
port: 8000
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 60
|
|
failureThreshold: 10
|
|
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /ping
|
|
port: 8000
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
failureThreshold: 20
|
|
|
|
imagePullSecrets:
|
|
- name: regcred |