Add RFI app with backend, frontend, Celery deployments, services, namespace, and PostgreSQL configuration in yc-k8s-test
This commit is contained in:
parent
a7716a59e7
commit
42ad7e986b
123
apps/rfi/base/backend-deployment.yaml
Normal file
123
apps/rfi/base/backend-deployment.yaml
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: rfi-backend-api
|
||||||
|
namespace: rfi
|
||||||
|
labels:
|
||||||
|
app: rfi-backend-api
|
||||||
|
service: api
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: rfi-backend-api
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: rfi-backend-api
|
||||||
|
service: api
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: api
|
||||||
|
image: cr.yandex/crp3ccidau046kdj8g9q/rfi-backend:production_d1e2e80d
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 8000
|
||||||
|
protocol: TCP
|
||||||
|
env:
|
||||||
|
- name: JWT_AUTH_ENABLE
|
||||||
|
value: "True"
|
||||||
|
- name: NOTIFICATIONS_ENABLE
|
||||||
|
value: "false"
|
||||||
|
- name: NOTIFICATIONS_EMAIL_FROM
|
||||||
|
value: hello@sarex.io
|
||||||
|
- name: NOTIFICATIONS_SERVICE_URL
|
||||||
|
value: https://srx.wb.ru/rfi
|
||||||
|
- name: SAREX_BACKEND_URL
|
||||||
|
value: http://backend.django.svc.cluster.local:8000
|
||||||
|
- name: EAV_URL
|
||||||
|
value: http://eav-service.eav.svc.cluster.local:8000
|
||||||
|
- name: GATEWAY_URL
|
||||||
|
value: http://pdm-api.documentations.svc.cluster.local:8080
|
||||||
|
- name: RABBITMQ_PORT
|
||||||
|
value: "5672"
|
||||||
|
- name: RABBITMQ_HOST
|
||||||
|
value: rabbitmq.rabbitmq.svc.cluster.local
|
||||||
|
- name: DJANGO_SECRET_KEY
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: django-secret
|
||||||
|
key: django_secret_key
|
||||||
|
- name: DB_HOST
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: postgresql-secrets
|
||||||
|
key: host
|
||||||
|
- name: DB_PORT
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: postgresql-secrets
|
||||||
|
key: port
|
||||||
|
- name: DB_NAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: postgresql-secrets
|
||||||
|
key: database
|
||||||
|
- name: DB_USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: postgresql-secrets
|
||||||
|
key: username
|
||||||
|
- name: DB_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: postgresql-secrets
|
||||||
|
key: password
|
||||||
|
- name: SAREX_BACKEND_AUTH
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: django-secret
|
||||||
|
key: token
|
||||||
|
- name: YC_S3_ACCESS_KEY_ID
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: s3-secret
|
||||||
|
key: key_id
|
||||||
|
- name: YC_S3_SECRET_ACCESS_KEY
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: s3-secret
|
||||||
|
key: access_key
|
||||||
|
- name: YC_S3_BUCKET_NAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: s3-secret
|
||||||
|
key: storage_bucket_name
|
||||||
|
- name: YC_S3_ENDPOINT_URL
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: s3-secret
|
||||||
|
key: endpoint_url
|
||||||
|
- name: RABBITMQ_VHOST
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: rabbitmq-secret
|
||||||
|
key: vhost
|
||||||
|
- name: RABBITMQ_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: rabbitmq-secret
|
||||||
|
key: username
|
||||||
|
- name: RABBITMQ_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: rabbitmq-secret
|
||||||
|
key: password
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "1"
|
||||||
|
memory: 1Gi
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: dockerhub
|
||||||
15
apps/rfi/base/backend-service.yaml
Normal file
15
apps/rfi/base/backend-service.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: rfi-backend-api-svc
|
||||||
|
namespace: rfi
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: rfi-backend-api
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 80
|
||||||
|
targetPort: 8000
|
||||||
|
protocol: TCP
|
||||||
133
apps/rfi/base/celery-deployment.yaml
Normal file
133
apps/rfi/base/celery-deployment.yaml
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: celery
|
||||||
|
namespace: rfi
|
||||||
|
labels:
|
||||||
|
app: celery
|
||||||
|
service: celery
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: celery
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: celery
|
||||||
|
service: celery
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: celery
|
||||||
|
image: cr.yandex/crp3ccidau046kdj8g9q/rfi-backend:dev4
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
command:
|
||||||
|
- uv
|
||||||
|
args:
|
||||||
|
- run
|
||||||
|
- celery
|
||||||
|
- -A
|
||||||
|
- config
|
||||||
|
- worker
|
||||||
|
- -l
|
||||||
|
- info
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 8000
|
||||||
|
protocol: TCP
|
||||||
|
env:
|
||||||
|
- name: JWT_AUTH_ENABLE
|
||||||
|
value: "True"
|
||||||
|
- name: NOTIFICATIONS_ENABLE
|
||||||
|
value: "false"
|
||||||
|
- name: NOTIFICATIONS_EMAIL_FROM
|
||||||
|
value: hello@sarex.io
|
||||||
|
- name: NOTIFICATIONS_SERVICE_URL
|
||||||
|
value: https://lk.srx.wb.ru:30443/rfi
|
||||||
|
- name: SAREX_BACKEND_URL
|
||||||
|
value: http://backend.django.svc.cluster.local:8000
|
||||||
|
- name: EAV_URL
|
||||||
|
value: http://eav-service.eav.svc.cluster.local:8000
|
||||||
|
- name: GATEWAY_URL
|
||||||
|
value: http://pdm-api.documentations.svc.cluster.local:8080
|
||||||
|
- name: RABBITMQ_PORT
|
||||||
|
value: "5672"
|
||||||
|
- name: RABBITMQ_HOST
|
||||||
|
value: rabbitmq.rabbitmq.svc.cluster.local
|
||||||
|
- name: DJANGO_SECRET_KEY
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: django-secret
|
||||||
|
key: django_secret_key
|
||||||
|
- name: DB_HOST
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: postgresql-secrets
|
||||||
|
key: host
|
||||||
|
- name: DB_PORT
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: postgresql-secrets
|
||||||
|
key: port
|
||||||
|
- name: DB_NAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: postgresql-secrets
|
||||||
|
key: database
|
||||||
|
- name: DB_USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: postgresql-secrets
|
||||||
|
key: username
|
||||||
|
- name: DB_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: postgresql-secrets
|
||||||
|
key: password
|
||||||
|
- name: SAREX_BACKEND_AUTH
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: django-secret
|
||||||
|
key: token
|
||||||
|
- name: YC_S3_ACCESS_KEY_ID
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: s3-secret
|
||||||
|
key: key_id
|
||||||
|
- name: YC_S3_SECRET_ACCESS_KEY
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: s3-secret
|
||||||
|
key: access_key
|
||||||
|
- name: YC_S3_BUCKET_NAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: s3-secret
|
||||||
|
key: storage_bucket_name
|
||||||
|
- name: YC_S3_ENDPOINT_URL
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: s3-secret
|
||||||
|
key: endpoint_url
|
||||||
|
- name: RABBITMQ_VHOST
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: rabbitmq-secret
|
||||||
|
key: vhost
|
||||||
|
- name: RABBITMQ_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: rabbitmq-secret
|
||||||
|
key: username
|
||||||
|
- name: RABBITMQ_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: rabbitmq-secret
|
||||||
|
key: password
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "1"
|
||||||
|
memory: 1Gi
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: dockerhub
|
||||||
32
apps/rfi/base/frontend-deployment.yaml
Normal file
32
apps/rfi/base/frontend-deployment.yaml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: rfi-frontend
|
||||||
|
namespace: rfi
|
||||||
|
labels:
|
||||||
|
app: rfi-frontend
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: rfi-frontend
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: rfi-frontend
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: rfi-frontend
|
||||||
|
image: cr.yandex/crp3ccidau046kdj8g9q/rfi-frontend:production_b827756f_wb
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 80
|
||||||
|
protocol: TCP
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 100Mi
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: dockerhub
|
||||||
15
apps/rfi/base/frontend-service.yaml
Normal file
15
apps/rfi/base/frontend-service.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: rfi-frontend-service
|
||||||
|
namespace: rfi
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: rfi-frontend
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 80
|
||||||
|
targetPort: 80
|
||||||
|
protocol: TCP
|
||||||
11
apps/rfi/base/kustomization.yaml
Normal file
11
apps/rfi/base/kustomization.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: rfi
|
||||||
|
resources:
|
||||||
|
- namespace.yaml
|
||||||
|
# - backend-deployment.yaml
|
||||||
|
# - celery-deployment.yaml
|
||||||
|
# - frontend-deployment.yaml
|
||||||
|
# - backend-service.yaml
|
||||||
|
# - frontend-service.yaml
|
||||||
7
apps/rfi/base/namespace.yaml
Normal file
7
apps/rfi/base/namespace.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: rfi
|
||||||
|
labels:
|
||||||
|
istio-injection: enabled
|
||||||
7
apps/rfi/yc-k8s-test/kustomization.yaml
Normal file
7
apps/rfi/yc-k8s-test/kustomization.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ../base
|
||||||
|
- postgresql.yaml
|
||||||
|
patches: []
|
||||||
110
apps/rfi/yc-k8s-test/postgresql.yaml
Normal file
110
apps/rfi/yc-k8s-test/postgresql.yaml
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: postgresql
|
||||||
|
namespace: rfi
|
||||||
|
spec:
|
||||||
|
interval: 5m
|
||||||
|
timeout: 2h
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: postgresql-contour
|
||||||
|
version: "17.0.2"
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: yc-oci-charts
|
||||||
|
namespace: flux-system
|
||||||
|
|
||||||
|
install:
|
||||||
|
timeout: 2h
|
||||||
|
remediation:
|
||||||
|
retries: 3
|
||||||
|
|
||||||
|
upgrade:
|
||||||
|
timeout: 2h
|
||||||
|
remediation:
|
||||||
|
retries: 3
|
||||||
|
|
||||||
|
values:
|
||||||
|
global:
|
||||||
|
security:
|
||||||
|
allowInsecureImages: true
|
||||||
|
defaultStorageClass: local-path
|
||||||
|
postgresql:
|
||||||
|
auth:
|
||||||
|
username: ""
|
||||||
|
database: ""
|
||||||
|
secretKeys:
|
||||||
|
userPasswordKey: "postgres-password"
|
||||||
|
auth:
|
||||||
|
username: ""
|
||||||
|
database: ""
|
||||||
|
secretKeys:
|
||||||
|
userPasswordKey: "postgres-password"
|
||||||
|
image:
|
||||||
|
registry: cr.yandex/crp3ccidau046kdj8g9q
|
||||||
|
repository: contour/postgresql
|
||||||
|
tag: 17.0.2
|
||||||
|
pullPolicy: Always
|
||||||
|
metrics:
|
||||||
|
enabled: false
|
||||||
|
prometheusRule:
|
||||||
|
enabled: false
|
||||||
|
primary:
|
||||||
|
containerSecurityContext:
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
persistence:
|
||||||
|
storageClass: local-path
|
||||||
|
size: 20Gi
|
||||||
|
customLivenessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- exec pg_isready -U "sarex" -d postgres -h 127.0.0.1 -p 5432
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
successThreshold: 1
|
||||||
|
failureThreshold: 6
|
||||||
|
customReadinessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- exec pg_isready -U "sarex" -d postgres -h 127.0.0.1 -p 5432
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
successThreshold: 1
|
||||||
|
failureThreshold: 6
|
||||||
|
customStartupProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- exec pg_isready -U "sarex" -d postgres -h 127.0.0.1 -p 5432
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
successThreshold: 1
|
||||||
|
failureThreshold: 6
|
||||||
|
nodeSelector:
|
||||||
|
dedicated: db
|
||||||
|
tolerations:
|
||||||
|
- key: dedicated
|
||||||
|
operator: Equal
|
||||||
|
value: db
|
||||||
|
effect: NoSchedule
|
||||||
|
contour:
|
||||||
|
enabled: true
|
||||||
|
adminUser: ""
|
||||||
|
adminPasswordSecretKey: ""
|
||||||
|
sharedPreloadLibraries: "pg_stat_statements"
|
||||||
|
databases:
|
||||||
|
- name: rfi_db
|
||||||
|
user: rfi
|
||||||
|
extensions: []
|
||||||
|
restoreFromDump: false
|
||||||
|
s3-proxy:
|
||||||
|
endpointUrl: "s3-proxy-service.postgresql.svc.cluster.local"
|
||||||
@ -15,4 +15,5 @@ resources:
|
|||||||
- ../../apps/measurements/yc-k8s-test
|
- ../../apps/measurements/yc-k8s-test
|
||||||
- ../../apps/drawings/yc-k8s-test
|
- ../../apps/drawings/yc-k8s-test
|
||||||
- ../../apps/comparisons/yc-k8s-test
|
- ../../apps/comparisons/yc-k8s-test
|
||||||
- ../../apps/contracts/yc-k8s-test
|
- ../../apps/contracts/yc-k8s-test
|
||||||
|
- ../../apps/rfi/yc-k8s-test
|
||||||
Loading…
Reference in New Issue
Block a user