++
This commit is contained in:
parent
5b21d9c438
commit
e003faeda2
153
apps/issues/base/backend-deployment.yaml
Normal file
153
apps/issues/base/backend-deployment.yaml
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: backend
|
||||||
|
namespace: issues
|
||||||
|
labels:
|
||||||
|
app: backend
|
||||||
|
service: backend
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: backend
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: backend
|
||||||
|
service: backend
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: backend
|
||||||
|
image: cr.yandex/crp3ccidau046kdj8g9q/issues:production_17c438aa
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 8000
|
||||||
|
protocol: TCP
|
||||||
|
env:
|
||||||
|
- name: ENVIRONMENT
|
||||||
|
value: production
|
||||||
|
- name: AERO_PUBLIC_HOST
|
||||||
|
value: https://srx.wb.ru
|
||||||
|
- name: AERO_HOST
|
||||||
|
value: https://srx.wb.ru
|
||||||
|
- name: BASE_AERO_URL
|
||||||
|
value: https://srx.wb.ru
|
||||||
|
- name: BASE_AUTH_URL
|
||||||
|
value: http://backend.django.svc.cluster.local:8000
|
||||||
|
- name: WORKFLOWS_HOST
|
||||||
|
value: http://workflows-api-service.workflow.svc.cluster.local:8000
|
||||||
|
- name: WORKFLOWS_URL
|
||||||
|
value: http://workflows-api-service.workflow.svc.cluster.local:8000
|
||||||
|
- name: RESOURCES_API_HOST
|
||||||
|
value: http://resources-service.resources.svc.cluster.local:8000
|
||||||
|
- name: EAV_HOST
|
||||||
|
value: http://eav-service.eav.svc.cluster.local:8000
|
||||||
|
- name: SAREX_API
|
||||||
|
value: https://srx.wb.ru
|
||||||
|
- name: DOCUMENTATIONS_URL
|
||||||
|
value: http://documentations-api.documentations.svc.cluster.local:8080
|
||||||
|
- name: DJANGO_SETTINGS_MODULE
|
||||||
|
value: config.settings.production
|
||||||
|
- name: API_ADDRESS
|
||||||
|
value: "8000"
|
||||||
|
- name: YC_S3_ACCESS_KEY_ID
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: username
|
||||||
|
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
|
||||||
|
- name: YC_S3_ENDPOINT_URL
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: host
|
||||||
|
name: s3-secret
|
||||||
|
- name: DJANGO_BASIC_AUTH
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: key
|
||||||
|
name: django-auth
|
||||||
|
- name: SAREX_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: username
|
||||||
|
name: sarex-auth
|
||||||
|
- name: SAREX_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: password
|
||||||
|
name: sarex-auth
|
||||||
|
- name: DATABASE_PORT
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: port
|
||||||
|
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_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: password
|
||||||
|
name: postgresql-secret
|
||||||
|
- name: DATABASE_NAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: database
|
||||||
|
name: postgresql-secret
|
||||||
|
- name: RABBITMQ_VHOST
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: vhost
|
||||||
|
name: rabbitmq-secret
|
||||||
|
- name: RABBITMQ_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: username
|
||||||
|
name: rabbitmq-secret
|
||||||
|
- name: RABBITMQ_HOSTNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: host
|
||||||
|
name: rabbitmq-secret
|
||||||
|
- name: RABBITMQ_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: password
|
||||||
|
name: rabbitmq-secret
|
||||||
|
- name: JWT_PRIVATE_KEY
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: ssh_private.key
|
||||||
|
name: backend-secret
|
||||||
|
- name: JWT_PUBLIC_KEY
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: ssh_public.key
|
||||||
|
name: backend-secret
|
||||||
|
|
||||||
|
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "1"
|
||||||
|
memory: 1Gi
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
15
apps/issues/base/backend-service.yaml
Normal file
15
apps/issues/base/backend-service.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: backend-svc
|
||||||
|
namespace: issues
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: backend
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 80
|
||||||
|
targetPort: 8000
|
||||||
|
protocol: TCP
|
||||||
153
apps/issues/base/celery-deployment.yaml
Normal file
153
apps/issues/base/celery-deployment.yaml
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: celery
|
||||||
|
namespace: issues
|
||||||
|
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/issues:production_17c438aa
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
command: ["celery", "-A", "config", "worker", "-l", "info", "-E"]
|
||||||
|
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 8000
|
||||||
|
protocol: TCP
|
||||||
|
env:
|
||||||
|
- name: ENVIRONMENT
|
||||||
|
value: production
|
||||||
|
- name: AERO_PUBLIC_HOST
|
||||||
|
value: https://srx.wb.ru
|
||||||
|
- name: AERO_HOST
|
||||||
|
value: https://srx.wb.ru
|
||||||
|
- name: BASE_AERO_URL
|
||||||
|
value: https://srx.wb.ru
|
||||||
|
- name: BASE_AUTH_URL
|
||||||
|
value: http://backend.django.svc.cluster.local:8000
|
||||||
|
- name: WORKFLOWS_HOST
|
||||||
|
value: http://workflows-api-service.workflow.svc.cluster.local:8000
|
||||||
|
- name: WORKFLOWS_URL
|
||||||
|
value: http://workflows-api-service.workflow.svc.cluster.local:8000
|
||||||
|
- name: RESOURCES_API_HOST
|
||||||
|
value: http://resources-service.resources.svc.cluster.local:8000
|
||||||
|
- name: EAV_HOST
|
||||||
|
value: http://eav-service.eav.svc.cluster.local:8000
|
||||||
|
- name: SAREX_API
|
||||||
|
value: https://srx.wb.ru
|
||||||
|
- name: DOCUMENTATIONS_URL
|
||||||
|
value: http://documentations-api.documentations.svc.cluster.local:8080
|
||||||
|
- name: DJANGO_SETTINGS_MODULE
|
||||||
|
value: config.settings.production
|
||||||
|
- name: API_ADDRESS
|
||||||
|
value: "8000"
|
||||||
|
- name: YC_S3_ACCESS_KEY_ID
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: username
|
||||||
|
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
|
||||||
|
- name: YC_S3_ENDPOINT_URL
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: host
|
||||||
|
name: s3-secret
|
||||||
|
- name: DJANGO_BASIC_AUTH
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: key
|
||||||
|
name: django-auth
|
||||||
|
- name: SAREX_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: username
|
||||||
|
name: sarex-auth
|
||||||
|
- name: SAREX_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: password
|
||||||
|
name: sarex-auth
|
||||||
|
- name: DATABASE_PORT
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: port
|
||||||
|
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_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: password
|
||||||
|
name: postgresql-secret
|
||||||
|
- name: DATABASE_NAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: database
|
||||||
|
name: postgresql-secret
|
||||||
|
- name: RABBITMQ_VHOST
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: vhost
|
||||||
|
name: rabbitmq-secret
|
||||||
|
- name: RABBITMQ_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: username
|
||||||
|
name: rabbitmq-secret
|
||||||
|
- name: RABBITMQ_HOSTNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: host
|
||||||
|
name: rabbitmq-secret
|
||||||
|
- name: RABBITMQ_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: password
|
||||||
|
name: rabbitmq-secret
|
||||||
|
- name: JWT_PRIVATE_KEY
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: ssh_private.key
|
||||||
|
name: backend-secret
|
||||||
|
- name: JWT_PUBLIC_KEY
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: ssh_public.key
|
||||||
|
name: backend-secret
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "1"
|
||||||
|
memory: 1Gi
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
32
apps/issues/base/frontend-deployment.yaml
Normal file
32
apps/issues/base/frontend-deployment.yaml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: frontend
|
||||||
|
namespace: issues
|
||||||
|
labels:
|
||||||
|
app: frontend
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: frontend
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: frontend
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: frontend
|
||||||
|
image: cr.yandex/crp3ccidau046kdj8g9q/contour_issues-frontend:716a2b73
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 80
|
||||||
|
protocol: TCP
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 100Mi
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
15
apps/issues/base/frontend-service.yaml
Normal file
15
apps/issues/base/frontend-service.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: frontend-service
|
||||||
|
namespace: issues
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: frontend
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 80
|
||||||
|
targetPort: 80
|
||||||
|
protocol: TCP
|
||||||
11
apps/issues/base/kustomization.yaml
Normal file
11
apps/issues/base/kustomization.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: issues
|
||||||
|
resources:
|
||||||
|
- namespace.yaml
|
||||||
|
- backend-deployment.yaml
|
||||||
|
- celery-deployment.yaml
|
||||||
|
- frontend-deployment.yaml
|
||||||
|
- backend-service.yaml
|
||||||
|
- frontend-service.yaml
|
||||||
7
apps/issues/base/namespace.yaml
Normal file
7
apps/issues/base/namespace.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: issues
|
||||||
|
labels:
|
||||||
|
istio-injection: enabled
|
||||||
7
apps/issues/yc-k8s-test/kustomization.yaml
Normal file
7
apps/issues/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/issues/yc-k8s-test/postgresql.yaml
Normal file
110
apps/issues/yc-k8s-test/postgresql.yaml
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: postgresql
|
||||||
|
namespace: issues
|
||||||
|
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: issues_db
|
||||||
|
user: issues
|
||||||
|
extensions: []
|
||||||
|
restoreFromDump: false
|
||||||
|
s3-proxy:
|
||||||
|
endpointUrl: "s3-proxy-service.postgresql.svc.cluster.local"
|
||||||
@ -31,4 +31,5 @@ resources:
|
|||||||
- ../../apps/workspaces/yc-k8s-test
|
- ../../apps/workspaces/yc-k8s-test
|
||||||
- ../../apps/cde/yc-k8s-test
|
- ../../apps/cde/yc-k8s-test
|
||||||
- ../../apps/flows/yc-k8s-test
|
- ../../apps/flows/yc-k8s-test
|
||||||
|
- ../../apps/issues/yc-k8s-test
|
||||||
- ../../apps/documentations/yc-k8s-test
|
- ../../apps/documentations/yc-k8s-test
|
||||||
Loading…
Reference in New Issue
Block a user