From f78ceb119e5c93101ecfcc1f03859a9f8be118f0 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 30 Jul 2026 19:09:24 +0500 Subject: [PATCH] change charts --- apps/comparisons/base/backend-deployment.yaml | 136 ---- apps/comparisons/base/backend-service.yaml | 15 - apps/comparisons/base/backend.yaml | 270 ++++++++ .../comparisons/base/frontend-deployment.yaml | 57 -- apps/comparisons/base/frontend-service.yaml | 15 - apps/comparisons/base/frontend.yaml | 135 ++++ apps/comparisons/base/kustomization.yaml | 7 +- apps/comparisons/base/serviceaccount.yaml | 5 - apps/comparisons/dsinv/backend.yaml | 187 ++++-- apps/comparisons/dsinv/frontend.yaml | 15 +- apps/comparisons/dsinv/kustomization.yaml | 4 +- .../yc-k8s-test/kustomization.yaml | 2 +- apps/comparisons/yc-k8s-test/replicas.yaml | 11 +- apps/document-link/base/deployment.yaml | 33 - apps/document-link/base/frontend.yaml | 90 +++ apps/document-link/base/kustomization.yaml | 3 +- apps/document-link/base/service.yaml | 15 - apps/document-link/dsinv/frontend.yaml | 15 +- apps/document-link/dsinv/kustomization.yaml | 2 +- apps/drawings/base/backend.yaml | 134 ++++ apps/drawings/base/deployment.yaml | 58 -- apps/drawings/base/kustomization.yaml | 4 +- apps/drawings/base/service.yaml | 15 - apps/drawings/base/serviceaccount.yaml | 5 - apps/drawings/yc-k8s-test/kustomization.yaml | 2 +- apps/drawings/yc-k8s-test/replicas.yaml | 11 +- apps/faas/base/backend-service.yaml | 15 - apps/faas/base/backend.yaml | 152 +++++ apps/faas/base/export-reviews.yaml | 64 -- apps/faas/base/kustomization.yaml | 3 +- apps/mapper/base/backend.yaml | 190 ++++++ apps/mapper/base/deployment.yaml | 105 --- apps/mapper/base/kustomization.yaml | 4 +- apps/mapper/base/service.yaml | 14 - apps/mapper/base/serviceaccount.yaml | 5 - apps/mapper/dsinv/backend.yaml | 56 +- apps/mapper/dsinv/kustomization.yaml | 2 +- apps/mapper/yc-k8s-test/kustomization.yaml | 2 +- apps/mapper/yc-k8s-test/replicas.yaml | 11 +- apps/measurements/base/backend.yaml | 130 ++++ apps/measurements/base/deployment.yaml | 55 -- apps/measurements/base/kustomization.yaml | 4 +- apps/measurements/base/service.yaml | 15 - apps/measurements/base/serviceaccount.yaml | 5 - apps/measurements/dsinv/kustomization.yaml | 2 +- apps/measurements/dsinv/measurements.yaml | 27 +- .../yc-k8s-test/kustomization.yaml | 2 +- apps/measurements/yc-k8s-test/replicas.yaml | 11 +- apps/prescriptions/base/deployment.yaml | 33 - apps/prescriptions/base/frontend.yaml | 90 +++ apps/prescriptions/base/kustomization.yaml | 3 +- apps/prescriptions/base/service.yaml | 15 - apps/processing/base/api-deployment.yaml | 77 --- apps/processing/base/api-service.yaml | 15 - apps/processing/base/api.yaml | 160 +++++ apps/processing/base/engine-low.yaml | 628 ++++++++++++------ apps/processing/base/engine.yaml | 612 +++++++++++------ apps/processing/base/frontend-deployment.yaml | 32 - apps/processing/base/frontend-service.yaml | 15 - apps/processing/base/frontend.yaml | 90 +++ apps/processing/base/kustomization.yaml | 7 +- apps/processing/base/serviceaccount.yaml | 5 - apps/projects/base/deployment.yaml | 46 -- apps/projects/base/frontend.yaml | 118 ++++ apps/projects/base/kustomization.yaml | 3 +- apps/projects/base/service.yaml | 15 - apps/projects/dsinv/kustomization.yaml | 4 +- .../dsinv/projects-frontend-static.yaml | 22 +- apps/stamp-verification/base/deployment.yaml | 33 - apps/stamp-verification/base/frontend.yaml | 90 +++ .../base/kustomization.yaml | 3 +- apps/stamp-verification/base/service.yaml | 15 - apps/system-log/base/api.yaml | 204 ++++++ apps/system-log/base/backend-deployment.yaml | 102 --- apps/system-log/base/backend-service.yaml | 15 - apps/system-log/base/kustomization.yaml | 6 +- apps/system-log/base/serviceaccount.yaml | 5 - apps/system-log/base/worker-deployment.yaml | 87 --- apps/system-log/base/worker.yaml | 177 +++++ apps/system-log/dsinv/api.yaml | 155 +++-- apps/system-log/dsinv/kustomization.yaml | 4 +- apps/system-log/dsinv/worker.yaml | 95 ++- 82 files changed, 3290 insertions(+), 1811 deletions(-) delete mode 100644 apps/comparisons/base/backend-deployment.yaml delete mode 100644 apps/comparisons/base/backend-service.yaml create mode 100644 apps/comparisons/base/backend.yaml delete mode 100644 apps/comparisons/base/frontend-deployment.yaml delete mode 100644 apps/comparisons/base/frontend-service.yaml create mode 100644 apps/comparisons/base/frontend.yaml delete mode 100644 apps/comparisons/base/serviceaccount.yaml delete mode 100644 apps/document-link/base/deployment.yaml create mode 100644 apps/document-link/base/frontend.yaml delete mode 100644 apps/document-link/base/service.yaml create mode 100644 apps/drawings/base/backend.yaml delete mode 100644 apps/drawings/base/deployment.yaml delete mode 100644 apps/drawings/base/service.yaml delete mode 100644 apps/drawings/base/serviceaccount.yaml delete mode 100644 apps/faas/base/backend-service.yaml create mode 100644 apps/faas/base/backend.yaml delete mode 100644 apps/faas/base/export-reviews.yaml create mode 100644 apps/mapper/base/backend.yaml delete mode 100644 apps/mapper/base/deployment.yaml delete mode 100644 apps/mapper/base/service.yaml delete mode 100644 apps/mapper/base/serviceaccount.yaml create mode 100644 apps/measurements/base/backend.yaml delete mode 100644 apps/measurements/base/deployment.yaml delete mode 100644 apps/measurements/base/service.yaml delete mode 100644 apps/measurements/base/serviceaccount.yaml delete mode 100644 apps/prescriptions/base/deployment.yaml create mode 100644 apps/prescriptions/base/frontend.yaml delete mode 100644 apps/prescriptions/base/service.yaml delete mode 100644 apps/processing/base/api-deployment.yaml delete mode 100644 apps/processing/base/api-service.yaml create mode 100644 apps/processing/base/api.yaml delete mode 100644 apps/processing/base/frontend-deployment.yaml delete mode 100644 apps/processing/base/frontend-service.yaml create mode 100644 apps/processing/base/frontend.yaml delete mode 100644 apps/processing/base/serviceaccount.yaml delete mode 100644 apps/projects/base/deployment.yaml create mode 100644 apps/projects/base/frontend.yaml delete mode 100644 apps/projects/base/service.yaml delete mode 100644 apps/stamp-verification/base/deployment.yaml create mode 100644 apps/stamp-verification/base/frontend.yaml delete mode 100644 apps/stamp-verification/base/service.yaml create mode 100644 apps/system-log/base/api.yaml delete mode 100644 apps/system-log/base/backend-deployment.yaml delete mode 100644 apps/system-log/base/backend-service.yaml delete mode 100644 apps/system-log/base/serviceaccount.yaml delete mode 100644 apps/system-log/base/worker-deployment.yaml create mode 100644 apps/system-log/base/worker.yaml diff --git a/apps/comparisons/base/backend-deployment.yaml b/apps/comparisons/base/backend-deployment.yaml deleted file mode 100644 index ee7c480..0000000 --- a/apps/comparisons/base/backend-deployment.yaml +++ /dev/null @@ -1,136 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: backend - namespace: comparisons - labels: - app: backend -spec: - replicas: 1 - selector: - matchLabels: - app: backend - template: - metadata: - labels: - app: backend - annotations: - traffic.sidecar.istio.io/excludeOutboundPorts: "8200" - vault.hashicorp.com/agent-init-first: "true" - vault.hashicorp.com/agent-inject: "true" - vault.hashicorp.com/agent-pre-populate-only: "true" - vault.hashicorp.com/auth-path: auth/kubernetes - vault.hashicorp.com/role: comparisons - vault.hashicorp.com/agent-inject-secret-comparisons-db: secrets/data/postgresql/apps/comparisons - vault.hashicorp.com/agent-inject-template-comparisons-db: |- - {{- with secret "secrets/data/postgresql/apps/comparisons" -}} - DATABASE_HOST=postgresql.comparisons.svc.cluster.local - DATABASE_PORT=5432 - DATABASE_DB=comparisons_db - DATABASE_USER={{ index .Data.data "username" }} - DATABASE_PASSWORD={{ index .Data.data "password" }} - POSTGRES_ADDRESS=postgresql.comparisons.svc.cluster.local - POSTGRES_PORT=5432 - POSTGRES_DB=comparisons_db - POSTGRES_USER={{ index .Data.data "username" }} - POSTGRES_PASSWORD={{ index .Data.data "password" }} - {{- end -}} - vault.hashicorp.com/agent-inject-secret-comparisons-jwt-public: secrets/data/vault/common/rsa_keys - vault.hashicorp.com/agent-inject-template-comparisons-jwt-public: |- - {{- with secret "secrets/data/vault/common/rsa_keys" -}} - {{ index .Data.data "public_key" }} - {{- end -}} - spec: - serviceAccountName: comparisons-vault - 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 - containers: - - name: backend - image: cr.yandex/crp3ccidau046kdj8g9q/comparisons_backend_prod:075fc0 - 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 - env: - - 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://documentations-service.documentations - - name: DOCUMENTATIONS_EXTERNAL_HOST - value: https://api.sarex.io/documentations - - name: DOCUMENTATION_FILESTREAM_URL - value: http://backend-filestream-svc.documentations.svc.cluster.local/ - - name: WORKFLOWS_HOST - value: http://workflows-service.processing - - name: WORKFLOWS_IMAGE_VERSION - value: master - - name: WORKFLOWS_DJANGO_HOST - value: https://lk.sarex.io - - name: WORKFLOWS_BIMV2_INTERNAL_HOST - value: http://bim-backend-v2-service.bim-api - - name: WORKSPACES_HOST - value: http://workspaces-service.workspaces - - name: EAV_HOST - value: https://api.sarex.io/eav - - 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 - resources: - requests: - cpu: 25m - memory: 100Mi - volumeMounts: - - name: tasks-execution-config - readOnly: true - mountPath: /etc/app/tasks-execution-config.json - subPath: tasks-execution-config.json - 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 diff --git a/apps/comparisons/base/backend-service.yaml b/apps/comparisons/base/backend-service.yaml deleted file mode 100644 index 4c3cab1..0000000 --- a/apps/comparisons/base/backend-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: backend-service - namespace: comparisons -spec: - type: ClusterIP - selector: - app: backend - ports: - - name: http - port: 8000 - targetPort: 8000 - protocol: TCP diff --git a/apps/comparisons/base/backend.yaml b/apps/comparisons/base/backend.yaml new file mode 100644 index 0000000..cdb60db --- /dev/null +++ b/apps/comparisons/base/backend.yaml @@ -0,0 +1,270 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: backend + namespace: comparisons + +spec: + interval: 10m + + chart: + spec: + chart: universal-chart + version: "0.1.9" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + + values: + global: + env: _default + + services: + backend: + enabled: true + + serviceAccount: + enabled: + _default: true + name: + _default: comparisons-vault + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/comparisons_backend_prod:075fc0 + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: backend + + replicaCount: + _default: 1 + + port: + _default: 8000 + + command: + _default: ["/bin/bash", "-ec"] + args: + _default: + - | + 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 + + resources: + requests: + cpu: + _default: 25m + memory: + _default: 100Mi + + probes: + liveness: + enabled: + _default: true + type: + _default: httpGet + httpGet: + path: + _default: /ping + port: + _default: 8000 + initialDelaySeconds: + _default: 10 + periodSeconds: + _default: 60 + failureThreshold: + _default: 10 + readiness: + enabled: + _default: true + type: + _default: httpGet + httpGet: + path: + _default: /ping + port: + _default: 8000 + initialDelaySeconds: + _default: 5 + periodSeconds: + _default: 5 + failureThreshold: + _default: 20 + + service: + enabled: true + + name: + _default: backend-service + + type: + _default: ClusterIP + + port: + _default: 8000 + + targetPort: + _default: 8000 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: regcred + + volumes: + _default: + - name: tasks-execution-config + mountPath: + _default: /etc/app/tasks-execution-config.json + subPath: + _default: tasks-execution-config.json + readOnly: + _default: true + configMap: + name: + _default: tasks-execution-config-comparisons-v2 + items: + - key: tasks-execution-config-comparisons-v2.json + path: + _default: tasks-execution-config.json + + envs: + - name: APP_NAME + value: + _default: "comparisons" + + - name: APP_VERSION + value: + _default: "0.0.1" + + - name: LOGGER_LOG_LEVEL + value: + _default: "info" + + - name: DATABASE_NAME + value: + _default: "postgres" + + - name: ENABLE_SSL + value: + _default: "false" + + - name: POSTGRES_POOL_SIZE + value: + _default: "10" + + - name: HTTP_PORT + value: + _default: "8000" + + - name: DOCUMENTATIONS_INTERNAL_HOST + value: + _default: "http://documentations-service.documentations" + + - name: DOCUMENTATIONS_EXTERNAL_HOST + value: + _default: "https://api.sarex.io/documentations" + + - name: DOCUMENTATION_FILESTREAM_URL + value: + _default: "http://backend-filestream-svc.documentations.svc.cluster.local/" + + - name: WORKFLOWS_HOST + value: + _default: "http://workflows-service.processing" + + - name: WORKFLOWS_IMAGE_VERSION + value: + _default: "master" + + - name: WORKFLOWS_DJANGO_HOST + value: + _default: "https://lk.sarex.io" + + - name: WORKFLOWS_BIMV2_INTERNAL_HOST + value: + _default: "http://bim-backend-v2-service.bim-api" + + - name: WORKSPACES_HOST + value: + _default: "http://workspaces-service.workspaces" + + - name: EAV_HOST + value: + _default: "https://api.sarex.io/eav" + + - name: LAST_MASTER_BIM + value: + _default: "36311" + + - name: LAST_SLAVE_1_BIM + value: + _default: "94015" + + - name: LAST_SLAVE_2_BIM + value: + _default: "135771" + + - name: ABAP_FIXED_CONC + value: + _default: "0" + + - name: WORKFLOWS_CONFIG_FILEPATH + value: + _default: "/etc/app/tasks-execution-config.json" + + podAnnotations: + _default: + traffic.sidecar.istio.io/excludeOutboundPorts: "8200" + vault.hashicorp.com/agent-init-first: "true" + vault.hashicorp.com/agent-inject: "true" + vault.hashicorp.com/agent-pre-populate-only: "true" + vault.hashicorp.com/auth-path: auth/kubernetes + vault.hashicorp.com/role: comparisons + vault.hashicorp.com/agent-inject-secret-comparisons-db: secrets/data/postgresql/apps/comparisons + vault.hashicorp.com/agent-inject-template-comparisons-db: |- + {{- with secret "secrets/data/postgresql/apps/comparisons" -}} + DATABASE_HOST=postgresql.comparisons.svc.cluster.local + DATABASE_PORT=5432 + DATABASE_DB=comparisons_db + DATABASE_USER={{ index .Data.data "username" }} + DATABASE_PASSWORD={{ index .Data.data "password" }} + POSTGRES_ADDRESS=postgresql.comparisons.svc.cluster.local + POSTGRES_PORT=5432 + POSTGRES_DB=comparisons_db + POSTGRES_USER={{ index .Data.data "username" }} + POSTGRES_PASSWORD={{ index .Data.data "password" }} + {{- end -}} + vault.hashicorp.com/agent-inject-secret-comparisons-jwt-public: secrets/data/vault/common/rsa_keys + vault.hashicorp.com/agent-inject-template-comparisons-jwt-public: |- + {{- with secret "secrets/data/vault/common/rsa_keys" -}} + {{ index .Data.data "public_key" }} + {{- end -}} + + commitSha: "" + gitlabUri: "" + gitlabJobUrl: "" + owner: "" diff --git a/apps/comparisons/base/frontend-deployment.yaml b/apps/comparisons/base/frontend-deployment.yaml deleted file mode 100644 index e9dea2a..0000000 --- a/apps/comparisons/base/frontend-deployment.yaml +++ /dev/null @@ -1,57 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: frontend - namespace: comparisons - labels: - app: frontend -spec: - replicas: 1 - selector: - matchLabels: - app: frontend - template: - metadata: - labels: - app: frontend - spec: - volumes: - - name: nginx-configmap - configMap: - name: nginx-configmap - items: - - key: nginx.conf - path: nginx.conf - containers: - - name: frontend - image: cr.yandex/crp3ccidau046kdj8g9q/comparisons-frontend:prod_6dc6e0c2 - imagePullPolicy: IfNotPresent - ports: - - name: http - containerPort: 80 - protocol: TCP - resources: - requests: - cpu: 25m - memory: 100Mi - volumeMounts: - - name: nginx-configmap - mountPath: /etc/nginx/nginx.conf - subPath: nginx.conf - livenessProbe: - httpGet: - path: /ping - port: 80 - initialDelaySeconds: 10 - periodSeconds: 10 - failureThreshold: 10 - readinessProbe: - httpGet: - path: /ping - port: 80 - initialDelaySeconds: 10 - periodSeconds: 10 - failureThreshold: 20 - imagePullSecrets: - - name: regcred diff --git a/apps/comparisons/base/frontend-service.yaml b/apps/comparisons/base/frontend-service.yaml deleted file mode 100644 index 2197ee6..0000000 --- a/apps/comparisons/base/frontend-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: frontend-service - namespace: comparisons -spec: - type: ClusterIP - selector: - app: frontend - ports: - - name: http - port: 80 - targetPort: 80 - protocol: TCP diff --git a/apps/comparisons/base/frontend.yaml b/apps/comparisons/base/frontend.yaml new file mode 100644 index 0000000..fc878db --- /dev/null +++ b/apps/comparisons/base/frontend.yaml @@ -0,0 +1,135 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: frontend + namespace: comparisons + +spec: + interval: 10m + + chart: + spec: + chart: universal-chart + version: "0.1.9" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + + values: + global: + env: _default + + services: + frontend: + enabled: true + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/comparisons-frontend:prod_6dc6e0c2 + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: frontend + + replicaCount: + _default: 1 + + port: + _default: 80 + + resources: + requests: + cpu: + _default: 25m + memory: + _default: 100Mi + + probes: + liveness: + enabled: + _default: true + type: + _default: httpGet + httpGet: + path: + _default: /ping + port: + _default: 80 + initialDelaySeconds: + _default: 10 + periodSeconds: + _default: 10 + failureThreshold: + _default: 10 + readiness: + enabled: + _default: true + type: + _default: httpGet + httpGet: + path: + _default: /ping + port: + _default: 80 + initialDelaySeconds: + _default: 10 + periodSeconds: + _default: 10 + failureThreshold: + _default: 20 + + service: + enabled: true + + name: + _default: frontend-service + + type: + _default: ClusterIP + + port: + _default: 80 + + targetPort: + _default: 80 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: regcred + + volumes: + _default: + - name: nginx-configmap + mountPath: + _default: /etc/nginx/nginx.conf + subPath: + _default: nginx.conf + readOnly: + _default: true + configMap: + name: + _default: nginx-configmap + items: + - key: nginx.conf + path: + _default: nginx.conf diff --git a/apps/comparisons/base/kustomization.yaml b/apps/comparisons/base/kustomization.yaml index 0ab9d12..e4adbfe 100644 --- a/apps/comparisons/base/kustomization.yaml +++ b/apps/comparisons/base/kustomization.yaml @@ -4,10 +4,7 @@ kind: Kustomization namespace: comparisons resources: - namespace.yaml - - serviceaccount.yaml - - backend-deployment.yaml - - backend-service.yaml - - frontend-deployment.yaml - - frontend-service.yaml + - backend.yaml + - frontend.yaml - nginx-configmap.yaml - tasks-execution-config.yaml diff --git a/apps/comparisons/base/serviceaccount.yaml b/apps/comparisons/base/serviceaccount.yaml deleted file mode 100644 index 0a78f2c..0000000 --- a/apps/comparisons/base/serviceaccount.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: comparisons-vault - namespace: comparisons diff --git a/apps/comparisons/dsinv/backend.yaml b/apps/comparisons/dsinv/backend.yaml index b61664c..8a056ae 100644 --- a/apps/comparisons/dsinv/backend.yaml +++ b/apps/comparisons/dsinv/backend.yaml @@ -1,63 +1,134 @@ --- -apiVersion: apps/v1 -kind: Deployment +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease metadata: name: backend namespace: comparisons spec: - template: - spec: - containers: - - name: backend - image: cr.yandex/crp3ccidau046kdj8g9q/comparisons-backend:8df50db379f53c35a20fdffd4803883564a11844 - env: - - name: HTTP_PORT - value: '8080' - - name: LAST_MASTER_BIM - value: '100_000' - - name: APP_NAME - value: comparisons-api-v2 - - name: APP_VERSION - value: 0.0.1 - - name: LOGGER_LOG_LEVEL - value: info - - name: DATABASE_HOST - value: postgres-service - - name: DATABASE_PORT - value: '5432' - - name: DATABASE_NAME - value: postgres - - name: DATABASE_DB - value: comparisons - - name: API_ADDRESS - value: 0.0.0.0:8080 - - name: API_ADDRESS_FILE - value: 0.0.0.0:8080 - - name: ENABLE_SQL_QUERY - value: '0' - - name: DOCUMENTATIONS_INTERNAL_HOST - value: http://documentations-service.documentations.svc.cluster.local:8080 - - name: DOCUMENTATIONS_EXTERNAL_HOST - value: http://documentations-service.documentations.svc.cluster.local:8080/ - - name: DOCUMENTATION_URL - value: http://documentations-service.documentations.svc.cluster.local:8080/ - - name: DOCUMENTATION_FILESTREAM_URL - value: http://documentations-filestream-service.documentations.svc.cluster.local:8080/ - - name: WORKFLOWS_HOST - value: http://workflows-service.workflow.svc.cluster.local:8000/ - - name: EAV_HOST - value: http://eav-service.eav.svc.cluster.local:8000 - - name: WORKSPACES_HOST - value: http://workspaces-service.workspaces.svc.cluster.local:8000/ - - name: COMPARISON_URL - value: http://backend-service.comparisons.svc.cluster.local:8080/ - - name: WORKFLOWS_IMAGE_VERSION - value: master - - name: EXTERNAL_DOCUMENTATION_URL - value: http://documentations-service.documentations.svc.cluster.local:8080/ - - name: WORKFLOWS_BIMV2_INTERNAL_HOST - value: http://backend-service.bim.svc.cluster.local:8000/ - - name: ENABLE_SSL - value: '0' - - name: WORKFLOWS_DJANGO_HOST - value: http://backend.django.svc.cluster.local:8000 + values: + services: + backend: + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/comparisons-backend:8df50db379f53c35a20fdffd4803883564a11844 + + envs: + - name: HTTP_PORT + value: + _default: "8080" + + - name: LAST_MASTER_BIM + value: + _default: "100_000" + + - name: APP_NAME + value: + _default: "comparisons-api-v2" + + - name: APP_VERSION + value: + _default: "0.0.1" + + - name: LOGGER_LOG_LEVEL + value: + _default: "info" + + - name: DATABASE_HOST + value: + _default: "postgres-service" + + - name: DATABASE_PORT + value: + _default: "5432" + + - name: DATABASE_NAME + value: + _default: "postgres" + + - name: DATABASE_DB + value: + _default: "comparisons" + + - name: API_ADDRESS + value: + _default: "0.0.0.0:8080" + + - name: API_ADDRESS_FILE + value: + _default: "0.0.0.0:8080" + + - name: ENABLE_SQL_QUERY + value: + _default: "0" + + - name: DOCUMENTATIONS_INTERNAL_HOST + value: + _default: "http://documentations-service.documentations.svc.cluster.local:8080" + + - name: DOCUMENTATIONS_EXTERNAL_HOST + value: + _default: "http://documentations-service.documentations.svc.cluster.local:8080/" + + - name: DOCUMENTATION_URL + value: + _default: "http://documentations-service.documentations.svc.cluster.local:8080/" + + - name: DOCUMENTATION_FILESTREAM_URL + value: + _default: "http://documentations-filestream-service.documentations.svc.cluster.local:8080/" + + - name: WORKFLOWS_HOST + value: + _default: "http://workflows-service.workflow.svc.cluster.local:8000/" + + - name: EAV_HOST + value: + _default: "http://eav-service.eav.svc.cluster.local:8000" + + - name: WORKSPACES_HOST + value: + _default: "http://workspaces-service.workspaces.svc.cluster.local:8000/" + + - name: COMPARISON_URL + value: + _default: "http://backend-service.comparisons.svc.cluster.local:8080/" + + - name: WORKFLOWS_IMAGE_VERSION + value: + _default: "master" + + - name: EXTERNAL_DOCUMENTATION_URL + value: + _default: "http://documentations-service.documentations.svc.cluster.local:8080/" + + - name: WORKFLOWS_BIMV2_INTERNAL_HOST + value: + _default: "http://backend-service.bim.svc.cluster.local:8000/" + + - name: ENABLE_SSL + value: + _default: "0" + + - name: WORKFLOWS_DJANGO_HOST + value: + _default: "http://backend.django.svc.cluster.local:8000" + + - name: POSTGRES_POOL_SIZE + value: + _default: "10" + + - name: LAST_SLAVE_1_BIM + value: + _default: "94015" + + - name: LAST_SLAVE_2_BIM + value: + _default: "135771" + + - name: ABAP_FIXED_CONC + value: + _default: "0" + + - name: WORKFLOWS_CONFIG_FILEPATH + value: + _default: "/etc/app/tasks-execution-config.json" diff --git a/apps/comparisons/dsinv/frontend.yaml b/apps/comparisons/dsinv/frontend.yaml index f787cb0..3edfcce 100644 --- a/apps/comparisons/dsinv/frontend.yaml +++ b/apps/comparisons/dsinv/frontend.yaml @@ -1,12 +1,13 @@ --- -apiVersion: apps/v1 -kind: Deployment +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease metadata: name: frontend namespace: comparisons spec: - template: - spec: - containers: - - name: frontend - image: cr.yandex/crp3ccidau046kdj8g9q/comparisons-frontend-static:9c422e6cd514603ea4092ed2430634cf4995039d + values: + services: + frontend: + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/comparisons-frontend-static:9c422e6cd514603ea4092ed2430634cf4995039d diff --git a/apps/comparisons/dsinv/kustomization.yaml b/apps/comparisons/dsinv/kustomization.yaml index 55fc114..748bf51 100644 --- a/apps/comparisons/dsinv/kustomization.yaml +++ b/apps/comparisons/dsinv/kustomization.yaml @@ -7,9 +7,9 @@ resources: patches: - path: backend.yaml target: - kind: Deployment + kind: HelmRelease name: backend - path: frontend.yaml target: - kind: Deployment + kind: HelmRelease name: frontend diff --git a/apps/comparisons/yc-k8s-test/kustomization.yaml b/apps/comparisons/yc-k8s-test/kustomization.yaml index 050d882..c8f7064 100644 --- a/apps/comparisons/yc-k8s-test/kustomization.yaml +++ b/apps/comparisons/yc-k8s-test/kustomization.yaml @@ -7,5 +7,5 @@ resources: patches: - path: replicas.yaml target: - kind: Deployment + kind: HelmRelease name: backend diff --git a/apps/comparisons/yc-k8s-test/replicas.yaml b/apps/comparisons/yc-k8s-test/replicas.yaml index 9ead5d9..bed52f6 100644 --- a/apps/comparisons/yc-k8s-test/replicas.yaml +++ b/apps/comparisons/yc-k8s-test/replicas.yaml @@ -1,8 +1,13 @@ --- -apiVersion: apps/v1 -kind: Deployment +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease metadata: name: backend namespace: comparisons spec: - replicas: 1 + values: + services: + backend: + deployment: + replicaCount: + _default: 1 diff --git a/apps/document-link/base/deployment.yaml b/apps/document-link/base/deployment.yaml deleted file mode 100644 index 897a215..0000000 --- a/apps/document-link/base/deployment.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: frontend - namespace: document-link - labels: - app: frontend -spec: - replicas: 1 - selector: - matchLabels: - app: frontend - template: - metadata: - labels: - app: frontend - version: stable - spec: - containers: - - name: frontend - image: cr.yandex/crp3ccidau046kdj8g9q/document-link-frontend:wb_cb2027ce - imagePullPolicy: IfNotPresent - ports: - - name: http - containerPort: 80 - protocol: TCP - resources: - requests: - cpu: 25m - memory: 100Mi - imagePullSecrets: - - name: regcred diff --git a/apps/document-link/base/frontend.yaml b/apps/document-link/base/frontend.yaml new file mode 100644 index 0000000..ad8222d --- /dev/null +++ b/apps/document-link/base/frontend.yaml @@ -0,0 +1,90 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: frontend + namespace: document-link + +spec: + interval: 10m + + chart: + spec: + chart: universal-chart + version: "0.1.9" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + + values: + global: + env: _default + + services: + frontend: + enabled: true + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/document-link-frontend:wb_cb2027ce + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: frontend + + replicaCount: + _default: 1 + + port: + _default: 80 + + resources: + requests: + cpu: + _default: 25m + memory: + _default: 100Mi + + probes: + liveness: + enabled: false + readiness: + enabled: false + + service: + enabled: true + + name: + _default: frontend-service + + type: + _default: ClusterIP + + port: + _default: 80 + + targetPort: + _default: 80 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: regcred diff --git a/apps/document-link/base/kustomization.yaml b/apps/document-link/base/kustomization.yaml index 649812b..54e758a 100644 --- a/apps/document-link/base/kustomization.yaml +++ b/apps/document-link/base/kustomization.yaml @@ -4,5 +4,4 @@ kind: Kustomization namespace: document-link resources: - namespace.yaml - - deployment.yaml - - service.yaml + - frontend.yaml diff --git a/apps/document-link/base/service.yaml b/apps/document-link/base/service.yaml deleted file mode 100644 index 8fca3f7..0000000 --- a/apps/document-link/base/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: frontend-service - namespace: document-link -spec: - type: ClusterIP - selector: - app: frontend - ports: - - name: http - port: 80 - targetPort: 80 - protocol: TCP diff --git a/apps/document-link/dsinv/frontend.yaml b/apps/document-link/dsinv/frontend.yaml index 7d34b6f..338d8f6 100644 --- a/apps/document-link/dsinv/frontend.yaml +++ b/apps/document-link/dsinv/frontend.yaml @@ -1,12 +1,13 @@ --- -apiVersion: apps/v1 -kind: Deployment +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease metadata: name: frontend namespace: document-link spec: - template: - spec: - containers: - - name: frontend - image: cr.yandex/crp3ccidau046kdj8g9q/document-link-frontend:21f0ef3d66575901d554ba675ba677708e4635c7 + values: + services: + frontend: + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/document-link-frontend:21f0ef3d66575901d554ba675ba677708e4635c7 diff --git a/apps/document-link/dsinv/kustomization.yaml b/apps/document-link/dsinv/kustomization.yaml index 4d55c9d..38411c5 100644 --- a/apps/document-link/dsinv/kustomization.yaml +++ b/apps/document-link/dsinv/kustomization.yaml @@ -8,5 +8,5 @@ resources: patches: - path: frontend.yaml target: - kind: Deployment + kind: HelmRelease name: frontend diff --git a/apps/drawings/base/backend.yaml b/apps/drawings/base/backend.yaml new file mode 100644 index 0000000..341bdb6 --- /dev/null +++ b/apps/drawings/base/backend.yaml @@ -0,0 +1,134 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: backend + namespace: drawings + +spec: + interval: 10m + + chart: + spec: + chart: universal-chart + version: "0.1.9" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + + values: + global: + env: _default + + services: + backend: + enabled: true + + serviceAccount: + enabled: + _default: true + name: + _default: drawings-vault + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/drawings-api:015e68e1b2a3dcc13f0b405e1f761b154a825d24 + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: backend + + replicaCount: + _default: 1 + + port: + _default: 8080 + + command: + _default: ["/bin/sh", "-ec"] + args: + _default: + - | + set -a + [ -f /vault/secrets/drawings-db ] && . /vault/secrets/drawings-db + set +a + exec ./entrypoint.sh + + probes: + liveness: + enabled: false + readiness: + enabled: false + + service: + enabled: true + + name: + _default: backend-service + + type: + _default: ClusterIP + + port: + _default: 8000 + + targetPort: + _default: 8000 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: regcred + + envs: + - name: POSTGRES_POOL_SIZE + value: + _default: "3" + + - name: API_ADDRESS + value: + _default: "0.0.0.0:8000" + + - name: ENABLE_SSL + value: + _default: "0" + + podAnnotations: + _default: + traffic.sidecar.istio.io/excludeOutboundPorts: "8200" + vault.hashicorp.com/agent-init-first: "true" + vault.hashicorp.com/agent-inject: "true" + vault.hashicorp.com/agent-pre-populate-only: "true" + vault.hashicorp.com/auth-path: auth/kubernetes + vault.hashicorp.com/role: drawings + vault.hashicorp.com/agent-inject-secret-drawings-db: secrets/data/postgresql/apps/drawings + vault.hashicorp.com/agent-inject-template-drawings-db: |- + {{- with secret "secrets/data/postgresql/apps/drawings" -}} + POSTGRES_ADDRESS=postgresql.drawings.svc.cluster.local:5432 + POSTGRES_DB=drawings_db + POSTGRES_USER={{ index .Data.data "username" }} + POSTGRES_PASSWORD={{ index .Data.data "password" }} + {{- end -}} + + commitSha: "" + gitlabUri: "" + gitlabJobUrl: "" + owner: "" diff --git a/apps/drawings/base/deployment.yaml b/apps/drawings/base/deployment.yaml deleted file mode 100644 index 5bdf229..0000000 --- a/apps/drawings/base/deployment.yaml +++ /dev/null @@ -1,58 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: backend - namespace: drawings - labels: - app: backend -spec: - replicas: 1 - selector: - matchLabels: - app: backend - template: - metadata: - labels: - app: backend - annotations: - traffic.sidecar.istio.io/excludeOutboundPorts: "8200" - vault.hashicorp.com/agent-init-first: "true" - vault.hashicorp.com/agent-inject: "true" - vault.hashicorp.com/agent-pre-populate-only: "true" - vault.hashicorp.com/auth-path: auth/kubernetes - vault.hashicorp.com/role: drawings - vault.hashicorp.com/agent-inject-secret-drawings-db: secrets/data/postgresql/apps/drawings - vault.hashicorp.com/agent-inject-template-drawings-db: |- - {{- with secret "secrets/data/postgresql/apps/drawings" -}} - POSTGRES_ADDRESS=postgresql.drawings.svc.cluster.local:5432 - POSTGRES_DB=drawings_db - POSTGRES_USER={{ index .Data.data "username" }} - POSTGRES_PASSWORD={{ index .Data.data "password" }} - {{- end -}} - spec: - serviceAccountName: drawings-vault - containers: - - name: backend - image: cr.yandex/crp3ccidau046kdj8g9q/drawings-api:015e68e1b2a3dcc13f0b405e1f761b154a825d24 - imagePullPolicy: IfNotPresent - command: ["/bin/sh", "-ec"] - args: - - | - set -a - [ -f /vault/secrets/drawings-db ] && . /vault/secrets/drawings-db - set +a - exec ./entrypoint.sh - ports: - - name: http - containerPort: 8080 - protocol: TCP - env: - - name: POSTGRES_POOL_SIZE - value: "3" - - name: API_ADDRESS - value: 0.0.0.0:8000 - - name: ENABLE_SSL - value: "0" - imagePullSecrets: - - name: regcred diff --git a/apps/drawings/base/kustomization.yaml b/apps/drawings/base/kustomization.yaml index 73f51c2..0f46661 100644 --- a/apps/drawings/base/kustomization.yaml +++ b/apps/drawings/base/kustomization.yaml @@ -4,6 +4,4 @@ kind: Kustomization namespace: drawings resources: - namespace.yaml - - serviceaccount.yaml - - deployment.yaml - - service.yaml + - backend.yaml diff --git a/apps/drawings/base/service.yaml b/apps/drawings/base/service.yaml deleted file mode 100644 index c40903e..0000000 --- a/apps/drawings/base/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: backend-service - namespace: drawings -spec: - type: ClusterIP - selector: - app: backend - ports: - - name: http - port: 8000 - targetPort: 8000 - protocol: TCP diff --git a/apps/drawings/base/serviceaccount.yaml b/apps/drawings/base/serviceaccount.yaml deleted file mode 100644 index 5578239..0000000 --- a/apps/drawings/base/serviceaccount.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: drawings-vault - namespace: drawings diff --git a/apps/drawings/yc-k8s-test/kustomization.yaml b/apps/drawings/yc-k8s-test/kustomization.yaml index d90fb04..df62dc0 100644 --- a/apps/drawings/yc-k8s-test/kustomization.yaml +++ b/apps/drawings/yc-k8s-test/kustomization.yaml @@ -7,5 +7,5 @@ resources: patches: - path: replicas.yaml target: - kind: Deployment + kind: HelmRelease name: backend \ No newline at end of file diff --git a/apps/drawings/yc-k8s-test/replicas.yaml b/apps/drawings/yc-k8s-test/replicas.yaml index d9db022..8857880 100644 --- a/apps/drawings/yc-k8s-test/replicas.yaml +++ b/apps/drawings/yc-k8s-test/replicas.yaml @@ -1,8 +1,13 @@ --- -apiVersion: apps/v1 -kind: Deployment +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease metadata: name: backend namespace: drawings spec: - replicas: 1 + values: + services: + backend: + deployment: + replicaCount: + _default: 1 diff --git a/apps/faas/base/backend-service.yaml b/apps/faas/base/backend-service.yaml deleted file mode 100644 index 946f3b9..0000000 --- a/apps/faas/base/backend-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: export-reviews-svc - namespace: faas -spec: - type: ClusterIP - selector: - app: export-reviews - ports: - - name: http - port: 80 - targetPort: 8000 - protocol: TCP diff --git a/apps/faas/base/backend.yaml b/apps/faas/base/backend.yaml new file mode 100644 index 0000000..62f92ab --- /dev/null +++ b/apps/faas/base/backend.yaml @@ -0,0 +1,152 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: export-reviews + namespace: faas + +spec: + interval: 10m + + chart: + spec: + chart: universal-chart + version: "0.1.9" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + + values: + global: + env: _default + + services: + backend: + enabled: true + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/export-reviews:prod_c4cae4ee + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: export-reviews + + replicaCount: + _default: 1 + + port: + _default: 8000 + + resources: + requests: + cpu: + _default: 25m + memory: + _default: 128Mi + + probes: + liveness: + enabled: false + readiness: + enabled: false + + service: + enabled: true + + name: + _default: export-reviews-svc + + type: + _default: ClusterIP + + port: + _default: 80 + + targetPort: + _default: 8000 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: regcred + + envs: + - name: BASE_HOST + value: + _default: "https://sarex.contour.infra.sarex.tech" + + - name: DJANGO_HOST + value: + _default: "https://sarex.contour.infra.sarex.tech" + + - name: REVIEWS_HOST + value: + _default: "https://sarex.contour.infra.sarex.tech/flows" + + - name: GATEWAY_HOST + value: + _default: "https://sarex.contour.infra.sarex.tech/gateway" + + - name: DOCUMENTATIONS_HOST + value: + _default: "https://sarex.contour.infra.sarex.tech/documentations" + + - name: EAV_HOST + value: + _default: "http://backend-svc.eav.svc.cluster.local:80" + + - name: TRANSMITTALS_INTERNAL_HOST + value: + _default: "http://transmittal-service.transmittal.svc.cluster.local:80/internal/v1" + + - name: DJANGO_TIMEOUT + value: + _default: "180" + + - name: REVIEWS_TIMEOUT + value: + _default: "180" + + - name: GATEWAY_TIMEOUT + value: + _default: "60" + + - name: DOCUMENTATIONS_TIMEOUT + value: + _default: "60" + + - name: EAV_TIMEOUT + value: + _default: "30" + + - name: TRANSMITTALS_TIMEOUT + value: + _default: "30" + + - name: TIMEOUT + value: + _default: "180" + + commitSha: "" + gitlabUri: "" + gitlabJobUrl: "" + owner: "" diff --git a/apps/faas/base/export-reviews.yaml b/apps/faas/base/export-reviews.yaml deleted file mode 100644 index c429c06..0000000 --- a/apps/faas/base/export-reviews.yaml +++ /dev/null @@ -1,64 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: export-reviews - namespace: faas - labels: - app: export-reviews - service: export-reviews -spec: - replicas: 1 - selector: - matchLabels: - app: export-reviews - template: - metadata: - labels: - app: export-reviews - service: export-reviews - spec: - containers: - - name: api - image: cr.yandex/crp3ccidau046kdj8g9q/export-reviews:prod_c4cae4ee - imagePullPolicy: IfNotPresent - ports: - - name: http - containerPort: 8000 - protocol: TCP - env: - - name: BASE_HOST - value: https://sarex.contour.infra.sarex.tech - - name: DJANGO_HOST - value: https://sarex.contour.infra.sarex.tech - - name: REVIEWS_HOST - value: https://sarex.contour.infra.sarex.tech/flows - - name: GATEWAY_HOST - value: https://sarex.contour.infra.sarex.tech/gateway - - name: DOCUMENTATIONS_HOST - value: https://sarex.contour.infra.sarex.tech/documentations - - name: EAV_HOST - value: http://backend-svc.eav.svc.cluster.local:80 - - name: TRANSMITTALS_INTERNAL_HOST - value: http://transmittal-service.transmittal.svc.cluster.local:80/internal/v1 - - name: DJANGO_TIMEOUT - value: "180" - - name: REVIEWS_TIMEOUT - value: "180" - - name: GATEWAY_TIMEOUT - value: "60" - - name: DOCUMENTATIONS_TIMEOUT - value: "60" - - name: EAV_TIMEOUT - value: "30" - - name: TRANSMITTALS_TIMEOUT - value: "30" - - name: TIMEOUT - value: "180" - - resources: - requests: - cpu: "25m" - memory: 128Mi - imagePullSecrets: - - name: regcred diff --git a/apps/faas/base/kustomization.yaml b/apps/faas/base/kustomization.yaml index c669ec0..61cf0b6 100644 --- a/apps/faas/base/kustomization.yaml +++ b/apps/faas/base/kustomization.yaml @@ -4,5 +4,4 @@ kind: Kustomization namespace: faas resources: - namespace.yaml - - export-reviews.yaml - - backend-service.yaml \ No newline at end of file + - backend.yaml \ No newline at end of file diff --git a/apps/mapper/base/backend.yaml b/apps/mapper/base/backend.yaml new file mode 100644 index 0000000..b5bf4d2 --- /dev/null +++ b/apps/mapper/base/backend.yaml @@ -0,0 +1,190 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: backend + namespace: mapper + +spec: + interval: 10m + + chart: + spec: + chart: universal-chart + version: "0.1.9" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + + values: + global: + env: _default + + services: + backend: + enabled: true + + serviceAccount: + enabled: + _default: true + name: + _default: mapper-vault + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/mapper:prod_b0d05a34 + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: backend + + replicaCount: + _default: 3 + + port: + _default: 8000 + + command: + _default: ["/bin/bash", "-ec"] + args: + _default: + - | + set -a + [ -f /vault/secrets/mapper-django-auth ] && . /vault/secrets/mapper-django-auth + [ -f /vault/secrets/mapper-db ] && . /vault/secrets/mapper-db + [ -f /vault/secrets/mapper-rabbitmq ] && . /vault/secrets/mapper-rabbitmq + [ -f /vault/secrets/mapper-s3 ] && . /vault/secrets/mapper-s3 + [ -f /vault/secrets/mapper-kafka ] && . /vault/secrets/mapper-kafka + set +a + exec /bin/bash /opt/entrypoint.sh + + resources: + requests: + cpu: + _default: 25m + memory: + _default: 128Mi + + probes: + liveness: + enabled: false + readiness: + enabled: false + + service: + enabled: true + + name: + _default: backend-svc + + type: + _default: ClusterIP + + port: + _default: 80 + + targetPort: + _default: 8000 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: regcred + + envs: + - name: DOCUMENTATION_HOST + value: + _default: "https://api.sarex.io/documentations/api/v1" + + - name: FLOW_HOST + value: + _default: "https://api.sarex.io/flows/api/v1" + + - name: DJANGO_HOST + value: + _default: "https://lk.sarex.io/api" + + - name: NOTE_HOST + value: + _default: "https://api.sarex.io/notes/api/v1" + + - name: REDIS_USE + value: + _default: "0" + + - name: TIMEOUT + value: + _default: "120" + + podAnnotations: + _default: + traffic.sidecar.istio.io/excludeOutboundPorts: "8200" + vault.hashicorp.com/agent-init-first: "true" + vault.hashicorp.com/agent-inject: "true" + vault.hashicorp.com/agent-pre-populate-only: "true" + vault.hashicorp.com/auth-path: auth/kubernetes + vault.hashicorp.com/role: mapper + vault.hashicorp.com/agent-inject-secret-mapper-django-auth: secrets/data/vault/common/django_auth + vault.hashicorp.com/agent-inject-template-mapper-django-auth: |- + {{- with secret "secrets/data/vault/common/django_auth" -}} + MAPPER_DJANGO_TOKEN={{ index .Data.data "key" }} + {{- end -}} + vault.hashicorp.com/agent-inject-secret-mapper-db: secrets/data/postgresql/apps/mapper + vault.hashicorp.com/agent-inject-template-mapper-db: |- + {{- with secret "secrets/data/postgresql/apps/mapper" -}} + MAPPER_DB_USER={{ index .Data.data "username" }} + MAPPER_DB_PASSWORD={{ index .Data.data "password" }} + MAPPER_DB_HOST=postgresql.mapper.svc.cluster.local + MAPPER_DB_PORT=5432 + MAPPER_DB_NAME=mapper_db + {{- end -}} + vault.hashicorp.com/agent-inject-secret-mapper-rabbitmq: secrets/data/rabbitmq/apps/mapper + vault.hashicorp.com/agent-inject-template-mapper-rabbitmq: |- + {{- with secret "secrets/data/rabbitmq/apps/mapper" -}} + MAPPER_RABBITMQ_VHOST={{ index .Data.data "vhost" }} + MAPPER_RABBITMQ_USERNAME={{ index .Data.data "username" }} + MAPPER_RABBITMQ_PASSWORD={{ index .Data.data "password" }} + MAPPER_RABBITMQ_HOST=rabbitmq.rabbitmq.svc.cluster.local + MAPPER_RABBITMQ_PORT=5672 + {{- end -}} + vault.hashicorp.com/agent-inject-secret-mapper-s3: secrets/data/minio/apps/mapper + vault.hashicorp.com/agent-inject-template-mapper-s3: |- + {{- with secret "secrets/data/minio/apps/mapper" -}} + MAPPER_S3_ENDPOINT={{ index .Data.data.client "endpoint" }} + MAPPER_S3_REGION={{ index .Data.data.client "region" }} + MAPPER_S3_BUCKET=mapper + MAPPER_S3_ACCESS_KEY_ID={{ index .Data.data "access_key" }} + MAPPER_S3_SECRET_ACCESS_KEY={{ index .Data.data "secret_key" }} + {{- end -}} + vault.hashicorp.com/agent-inject-secret-mapper-kafka: secrets/data/kafka/apps/mapper + vault.hashicorp.com/agent-inject-template-mapper-kafka: |- + {{- with secret "secrets/data/kafka/apps/mapper" -}} + MAPPER_KAFKA_BOOTSTRAP_SERVERS={{ index .Data.data.auth "bootstrap_servers" }} + MAPPER_KAFKA_SECURITY_PROTOCOL={{ index .Data.data.auth "security_protocol" }} + MAPPER_KAFKA_SASL_MECHANISM={{ index .Data.data.auth "sasl_mechanism" }} + MAPPER_KAFKA_USERNAME={{ index .Data.data "username" }} + MAPPER_KAFKA_PASSWORD={{ index .Data.data "password" }} + {{- end -}} + + commitSha: "" + gitlabUri: "" + gitlabJobUrl: "" + owner: "" diff --git a/apps/mapper/base/deployment.yaml b/apps/mapper/base/deployment.yaml deleted file mode 100644 index efaf506..0000000 --- a/apps/mapper/base/deployment.yaml +++ /dev/null @@ -1,105 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: backend - namespace: mapper - labels: - app: backend -spec: - replicas: 3 - selector: - matchLabels: - app: backend - template: - metadata: - labels: - app: backend - annotations: - traffic.sidecar.istio.io/excludeOutboundPorts: "8200" - vault.hashicorp.com/agent-init-first: "true" - vault.hashicorp.com/agent-inject: "true" - vault.hashicorp.com/agent-pre-populate-only: "true" - vault.hashicorp.com/auth-path: auth/kubernetes - vault.hashicorp.com/role: mapper - vault.hashicorp.com/agent-inject-secret-mapper-django-auth: secrets/data/vault/common/django_auth - vault.hashicorp.com/agent-inject-template-mapper-django-auth: |- - {{- with secret "secrets/data/vault/common/django_auth" -}} - MAPPER_DJANGO_TOKEN={{ index .Data.data "key" }} - {{- end -}} - vault.hashicorp.com/agent-inject-secret-mapper-db: secrets/data/postgresql/apps/mapper - vault.hashicorp.com/agent-inject-template-mapper-db: |- - {{- with secret "secrets/data/postgresql/apps/mapper" -}} - MAPPER_DB_USER={{ index .Data.data "username" }} - MAPPER_DB_PASSWORD={{ index .Data.data "password" }} - MAPPER_DB_HOST=postgresql.mapper.svc.cluster.local - MAPPER_DB_PORT=5432 - MAPPER_DB_NAME=mapper_db - {{- end -}} - vault.hashicorp.com/agent-inject-secret-mapper-rabbitmq: secrets/data/rabbitmq/apps/mapper - vault.hashicorp.com/agent-inject-template-mapper-rabbitmq: |- - {{- with secret "secrets/data/rabbitmq/apps/mapper" -}} - MAPPER_RABBITMQ_VHOST={{ index .Data.data "vhost" }} - MAPPER_RABBITMQ_USERNAME={{ index .Data.data "username" }} - MAPPER_RABBITMQ_PASSWORD={{ index .Data.data "password" }} - MAPPER_RABBITMQ_HOST=rabbitmq.rabbitmq.svc.cluster.local - MAPPER_RABBITMQ_PORT=5672 - {{- end -}} - vault.hashicorp.com/agent-inject-secret-mapper-s3: secrets/data/minio/apps/mapper - vault.hashicorp.com/agent-inject-template-mapper-s3: |- - {{- with secret "secrets/data/minio/apps/mapper" -}} - MAPPER_S3_ENDPOINT={{ index .Data.data.client "endpoint" }} - MAPPER_S3_REGION={{ index .Data.data.client "region" }} - MAPPER_S3_BUCKET=mapper - MAPPER_S3_ACCESS_KEY_ID={{ index .Data.data "access_key" }} - MAPPER_S3_SECRET_ACCESS_KEY={{ index .Data.data "secret_key" }} - {{- end -}} - vault.hashicorp.com/agent-inject-secret-mapper-kafka: secrets/data/kafka/apps/mapper - vault.hashicorp.com/agent-inject-template-mapper-kafka: |- - {{- with secret "secrets/data/kafka/apps/mapper" -}} - MAPPER_KAFKA_BOOTSTRAP_SERVERS={{ index .Data.data.auth "bootstrap_servers" }} - MAPPER_KAFKA_SECURITY_PROTOCOL={{ index .Data.data.auth "security_protocol" }} - MAPPER_KAFKA_SASL_MECHANISM={{ index .Data.data.auth "sasl_mechanism" }} - MAPPER_KAFKA_USERNAME={{ index .Data.data "username" }} - MAPPER_KAFKA_PASSWORD={{ index .Data.data "password" }} - {{- end -}} - spec: - serviceAccountName: mapper-vault - containers: - - name: backend - image: cr.yandex/crp3ccidau046kdj8g9q/mapper:prod_b0d05a34 - imagePullPolicy: IfNotPresent - command: ["/bin/bash", "-ec"] - args: - - | - set -a - [ -f /vault/secrets/mapper-django-auth ] && . /vault/secrets/mapper-django-auth - [ -f /vault/secrets/mapper-db ] && . /vault/secrets/mapper-db - [ -f /vault/secrets/mapper-rabbitmq ] && . /vault/secrets/mapper-rabbitmq - [ -f /vault/secrets/mapper-s3 ] && . /vault/secrets/mapper-s3 - [ -f /vault/secrets/mapper-kafka ] && . /vault/secrets/mapper-kafka - set +a - exec /bin/bash /opt/entrypoint.sh - ports: - - name: http - containerPort: 8000 - protocol: TCP - env: - - name: DOCUMENTATION_HOST - value: https://api.sarex.io/documentations/api/v1 - - name: FLOW_HOST - value: https://api.sarex.io/flows/api/v1 - - name: DJANGO_HOST - value: https://lk.sarex.io/api - - name: NOTE_HOST - value: https://api.sarex.io/notes/api/v1 - - name: REDIS_USE - value: "0" - - name: TIMEOUT - value: "120" - resources: - requests: - cpu: "25m" - memory: 128Mi - imagePullSecrets: - - name: regcred diff --git a/apps/mapper/base/kustomization.yaml b/apps/mapper/base/kustomization.yaml index 952bab2..ea27d65 100644 --- a/apps/mapper/base/kustomization.yaml +++ b/apps/mapper/base/kustomization.yaml @@ -4,6 +4,4 @@ kind: Kustomization namespace: mapper resources: - namespace.yaml - - serviceaccount.yaml - - deployment.yaml - - service.yaml + - backend.yaml diff --git a/apps/mapper/base/service.yaml b/apps/mapper/base/service.yaml deleted file mode 100644 index 8eac4e3..0000000 --- a/apps/mapper/base/service.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: backend-svc - namespace: mapper -spec: - type: ClusterIP - selector: - app: backend - ports: - - port: 80 - targetPort: 8000 - protocol: TCP diff --git a/apps/mapper/base/serviceaccount.yaml b/apps/mapper/base/serviceaccount.yaml deleted file mode 100644 index 79d1166..0000000 --- a/apps/mapper/base/serviceaccount.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: mapper-vault - namespace: mapper diff --git a/apps/mapper/dsinv/backend.yaml b/apps/mapper/dsinv/backend.yaml index e3b91e9..9ec7b68 100644 --- a/apps/mapper/dsinv/backend.yaml +++ b/apps/mapper/dsinv/backend.yaml @@ -1,24 +1,42 @@ --- -apiVersion: apps/v1 -kind: Deployment +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease metadata: name: backend namespace: mapper spec: - replicas: 1 - template: - spec: - containers: - - name: backend - image: cr.yandex/crp3ccidau046kdj8g9q/mapper:0.0.8 - env: - - name: DOCUMENTATION_HOST - value: http://backend-service.flows.svc.cluster.local:8000/api/v1 - - name: FLOW_HOST - value: http://backend-service.flows.svc.cluster.local:8000/api/v1 - - name: DJANGO_HOST - value: http://backend.django.svc.cluster.local:8000/api - - name: NOTE_HOST - value: http://backend-service.notes.svc.cluster.local:8000/api/v1 - - name: REDIS_USE - value: '0' + values: + services: + backend: + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/mapper:0.0.8 + + deployment: + replicaCount: + _default: 1 + + envs: + - name: DOCUMENTATION_HOST + value: + _default: "http://backend-service.flows.svc.cluster.local:8000/api/v1" + + - name: FLOW_HOST + value: + _default: "http://backend-service.flows.svc.cluster.local:8000/api/v1" + + - name: DJANGO_HOST + value: + _default: "http://backend.django.svc.cluster.local:8000/api" + + - name: NOTE_HOST + value: + _default: "http://backend-service.notes.svc.cluster.local:8000/api/v1" + + - name: REDIS_USE + value: + _default: "0" + + - name: TIMEOUT + value: + _default: "120" diff --git a/apps/mapper/dsinv/kustomization.yaml b/apps/mapper/dsinv/kustomization.yaml index 03fc898..65befca 100644 --- a/apps/mapper/dsinv/kustomization.yaml +++ b/apps/mapper/dsinv/kustomization.yaml @@ -7,5 +7,5 @@ resources: patches: - path: backend.yaml target: - kind: Deployment + kind: HelmRelease name: backend diff --git a/apps/mapper/yc-k8s-test/kustomization.yaml b/apps/mapper/yc-k8s-test/kustomization.yaml index 8b31483..1ee38d5 100644 --- a/apps/mapper/yc-k8s-test/kustomization.yaml +++ b/apps/mapper/yc-k8s-test/kustomization.yaml @@ -6,5 +6,5 @@ resources: patches: - path: replicas.yaml target: - kind: Deployment + kind: HelmRelease name: backend diff --git a/apps/mapper/yc-k8s-test/replicas.yaml b/apps/mapper/yc-k8s-test/replicas.yaml index 81e9a96..c1b4681 100644 --- a/apps/mapper/yc-k8s-test/replicas.yaml +++ b/apps/mapper/yc-k8s-test/replicas.yaml @@ -1,8 +1,13 @@ --- -apiVersion: apps/v1 -kind: Deployment +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease metadata: name: backend namespace: mapper spec: - replicas: 1 + values: + services: + backend: + deployment: + replicaCount: + _default: 1 diff --git a/apps/measurements/base/backend.yaml b/apps/measurements/base/backend.yaml new file mode 100644 index 0000000..1aeb6e1 --- /dev/null +++ b/apps/measurements/base/backend.yaml @@ -0,0 +1,130 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: measurements + namespace: measurements + +spec: + interval: 10m + + chart: + spec: + chart: universal-chart + version: "0.1.9" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + + values: + global: + env: _default + + services: + backend: + enabled: true + + serviceAccount: + enabled: + _default: true + name: + _default: measurements-vault + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/measurements:production_a5bb3e84 + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: measurements + + replicaCount: + _default: 1 + + port: + _default: 8000 + + command: + _default: ["/bin/bash", "-ec"] + args: + _default: + - | + set -a + [ -f /vault/secrets/measurements-s3 ] && . /vault/secrets/measurements-s3 + set +a + exec /opt/entrypoint.sh + + resources: + requests: + cpu: + _default: 25m + memory: + _default: 128Mi + + probes: + liveness: + enabled: false + readiness: + enabled: false + + service: + enabled: true + + name: + _default: measurements-svc + + type: + _default: ClusterIP + + port: + _default: 8000 + + targetPort: + _default: 8000 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: regcred + + envs: + - name: TRACING_USE + value: + _default: "false" + + podAnnotations: + _default: + traffic.sidecar.istio.io/excludeOutboundPorts: "8200" + vault.hashicorp.com/agent-init-first: "true" + vault.hashicorp.com/agent-inject: "true" + vault.hashicorp.com/agent-pre-populate-only: "true" + vault.hashicorp.com/auth-path: auth/kubernetes + vault.hashicorp.com/role: measurements + vault.hashicorp.com/agent-inject-secret-measurements-s3: secrets/data/minio/apps/measurements + vault.hashicorp.com/agent-inject-template-measurements-s3: |- + {{- with secret "secrets/data/minio/apps/measurements" -}} + S3_JSON_SETTINGS='{"host":"{{ index .Data.data.client "endpoint" }}","login":"{{ index .Data.data "access_key" }}","password":"{{ index .Data.data "secret_key" }}","verify":false,"buckets":["measurements"]}' + {{- end -}} + + commitSha: "" + gitlabUri: "" + gitlabJobUrl: "" + owner: "" diff --git a/apps/measurements/base/deployment.yaml b/apps/measurements/base/deployment.yaml deleted file mode 100644 index 7fe6ae8..0000000 --- a/apps/measurements/base/deployment.yaml +++ /dev/null @@ -1,55 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: measurements - namespace: measurements - labels: - app: measurements -spec: - replicas: 1 - selector: - matchLabels: - app: measurements - template: - metadata: - labels: - app: measurements - annotations: - traffic.sidecar.istio.io/excludeOutboundPorts: "8200" - vault.hashicorp.com/agent-init-first: "true" - vault.hashicorp.com/agent-inject: "true" - vault.hashicorp.com/agent-pre-populate-only: "true" - vault.hashicorp.com/auth-path: auth/kubernetes - vault.hashicorp.com/role: measurements - vault.hashicorp.com/agent-inject-secret-measurements-s3: secrets/data/minio/apps/measurements - vault.hashicorp.com/agent-inject-template-measurements-s3: |- - {{- with secret "secrets/data/minio/apps/measurements" -}} - S3_JSON_SETTINGS='{"host":"{{ index .Data.data.client "endpoint" }}","login":"{{ index .Data.data "access_key" }}","password":"{{ index .Data.data "secret_key" }}","verify":false,"buckets":["measurements"]}' - {{- end -}} - spec: - serviceAccountName: measurements-vault - containers: - - name: measurements - image: cr.yandex/crp3ccidau046kdj8g9q/measurements:production_a5bb3e84 - imagePullPolicy: IfNotPresent - command: ["/bin/bash", "-ec"] - args: - - | - set -a - [ -f /vault/secrets/measurements-s3 ] && . /vault/secrets/measurements-s3 - set +a - exec /opt/entrypoint.sh - ports: - - name: http - containerPort: 8000 - protocol: TCP - env: - - name: TRACING_USE - value: "false" - resources: - requests: - cpu: 25m - memory: 128Mi - imagePullSecrets: - - name: regcred diff --git a/apps/measurements/base/kustomization.yaml b/apps/measurements/base/kustomization.yaml index d379532..50855c1 100644 --- a/apps/measurements/base/kustomization.yaml +++ b/apps/measurements/base/kustomization.yaml @@ -4,6 +4,4 @@ kind: Kustomization namespace: measurements resources: - namespace.yaml - - serviceaccount.yaml - - deployment.yaml - - service.yaml + - backend.yaml diff --git a/apps/measurements/base/service.yaml b/apps/measurements/base/service.yaml deleted file mode 100644 index 54518e2..0000000 --- a/apps/measurements/base/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: measurements-svc - namespace: measurements -spec: - type: ClusterIP - selector: - app: measurements - ports: - - name: http - port: 8000 - targetPort: 8000 - protocol: TCP diff --git a/apps/measurements/base/serviceaccount.yaml b/apps/measurements/base/serviceaccount.yaml deleted file mode 100644 index eed4acc..0000000 --- a/apps/measurements/base/serviceaccount.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: measurements-vault - namespace: measurements diff --git a/apps/measurements/dsinv/kustomization.yaml b/apps/measurements/dsinv/kustomization.yaml index 0379aae..476dd49 100644 --- a/apps/measurements/dsinv/kustomization.yaml +++ b/apps/measurements/dsinv/kustomization.yaml @@ -7,5 +7,5 @@ resources: patches: - path: measurements.yaml target: - kind: Deployment + kind: HelmRelease name: measurements diff --git a/apps/measurements/dsinv/measurements.yaml b/apps/measurements/dsinv/measurements.yaml index f52c44c..37f4a2e 100644 --- a/apps/measurements/dsinv/measurements.yaml +++ b/apps/measurements/dsinv/measurements.yaml @@ -1,15 +1,22 @@ --- -apiVersion: apps/v1 -kind: Deployment +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease metadata: name: measurements namespace: measurements spec: - template: - spec: - containers: - - name: measurements - image: cr.yandex/crp3ccidau046kdj8g9q/measurements:0.4.3 - env: - - name: DJANGO_HOST - value: https://sarex.dsinv.ru + values: + services: + backend: + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/measurements:0.4.3 + + envs: + - name: TRACING_USE + value: + _default: "false" + + - name: DJANGO_HOST + value: + _default: "https://sarex.dsinv.ru" diff --git a/apps/measurements/yc-k8s-test/kustomization.yaml b/apps/measurements/yc-k8s-test/kustomization.yaml index ac395b8..16989f3 100644 --- a/apps/measurements/yc-k8s-test/kustomization.yaml +++ b/apps/measurements/yc-k8s-test/kustomization.yaml @@ -6,5 +6,5 @@ resources: patches: - path: replicas.yaml target: - kind: Deployment + kind: HelmRelease name: measurements \ No newline at end of file diff --git a/apps/measurements/yc-k8s-test/replicas.yaml b/apps/measurements/yc-k8s-test/replicas.yaml index 2bb893f..39aa334 100644 --- a/apps/measurements/yc-k8s-test/replicas.yaml +++ b/apps/measurements/yc-k8s-test/replicas.yaml @@ -1,8 +1,13 @@ --- -apiVersion: apps/v1 -kind: Deployment +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease metadata: name: measurements namespace: measurements spec: - replicas: 1 + values: + services: + backend: + deployment: + replicaCount: + _default: 1 diff --git a/apps/prescriptions/base/deployment.yaml b/apps/prescriptions/base/deployment.yaml deleted file mode 100644 index 6de770d..0000000 --- a/apps/prescriptions/base/deployment.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: frontend - namespace: prescriptions - labels: - app: frontend -spec: - replicas: 1 - selector: - matchLabels: - app: frontend - template: - metadata: - labels: - app: frontend - version: stable - spec: - containers: - - name: frontend - image: cr.yandex/crp3ccidau046kdj8g9q/prescriptions-frontend:production_d48699e6 - imagePullPolicy: IfNotPresent - ports: - - name: http - containerPort: 80 - protocol: TCP - resources: - requests: - cpu: 25m - memory: 100Mi - imagePullSecrets: - - name: regcred diff --git a/apps/prescriptions/base/frontend.yaml b/apps/prescriptions/base/frontend.yaml new file mode 100644 index 0000000..e1a6c78 --- /dev/null +++ b/apps/prescriptions/base/frontend.yaml @@ -0,0 +1,90 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: frontend + namespace: prescriptions + +spec: + interval: 10m + + chart: + spec: + chart: universal-chart + version: "0.1.9" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + + values: + global: + env: _default + + services: + frontend: + enabled: true + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/prescriptions-frontend:production_d48699e6 + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: frontend + + replicaCount: + _default: 1 + + port: + _default: 80 + + resources: + requests: + cpu: + _default: 25m + memory: + _default: 100Mi + + probes: + liveness: + enabled: false + readiness: + enabled: false + + service: + enabled: true + + name: + _default: frontend-service + + type: + _default: ClusterIP + + port: + _default: 80 + + targetPort: + _default: 80 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: regcred diff --git a/apps/prescriptions/base/kustomization.yaml b/apps/prescriptions/base/kustomization.yaml index 7f89e92..da6ecaf 100644 --- a/apps/prescriptions/base/kustomization.yaml +++ b/apps/prescriptions/base/kustomization.yaml @@ -4,5 +4,4 @@ kind: Kustomization namespace: prescriptions resources: - namespace.yaml - - deployment.yaml - - service.yaml + - frontend.yaml diff --git a/apps/prescriptions/base/service.yaml b/apps/prescriptions/base/service.yaml deleted file mode 100644 index aea0575..0000000 --- a/apps/prescriptions/base/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: frontend-service - namespace: prescriptions -spec: - type: ClusterIP - selector: - app: frontend - ports: - - name: http - port: 80 - targetPort: 80 - protocol: TCP diff --git a/apps/processing/base/api-deployment.yaml b/apps/processing/base/api-deployment.yaml deleted file mode 100644 index 7e0bbba..0000000 --- a/apps/processing/base/api-deployment.yaml +++ /dev/null @@ -1,77 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: workflows-api - namespace: processing - labels: - app: workflows-api - service: workflows-api -spec: - replicas: 1 - selector: - matchLabels: - app: workflows-api - template: - metadata: - labels: - app: workflows-api - service: workflows-api - annotations: - traffic.sidecar.istio.io/excludeOutboundPorts: "8200" - vault.hashicorp.com/agent-init-first: "true" - vault.hashicorp.com/agent-inject: "true" - vault.hashicorp.com/agent-pre-populate-only: "true" - vault.hashicorp.com/auth-path: auth/kubernetes - vault.hashicorp.com/role: processing - vault.hashicorp.com/agent-inject-secret-processing-postgresql: secrets/data/postgresql/apps/processing - vault.hashicorp.com/agent-inject-template-processing-postgresql: |- - {{- with secret "secrets/data/postgresql/apps/processing" -}} - POSTGRES_ADDRESS=postgresql.processing.svc.cluster.local - POSTGRES_PORT=5432 - POSTGRES_USER={{ index .Data.data "username" }} - POSTGRES_PASSWORD={{ index .Data.data "password" }} - POSTGRES_DB=workflow_db - {{- end -}} - vault.hashicorp.com/agent-inject-secret-processing-jwt-public: secrets/data/vault/common/rsa_keys - vault.hashicorp.com/agent-inject-template-processing-jwt-public: |- - {{- with secret "secrets/data/vault/common/rsa_keys" -}} - {{ index .Data.data "public_key" }} - {{- end -}} - spec: - serviceAccountName: processing-vault - containers: - - name: workflows-api - image: cr.yandex/crp3ccidau046kdj8g9q/workflows-api_prod:075fc0 - imagePullPolicy: IfNotPresent - command: ["/bin/bash", "-ec"] - args: - - | - set -a - [ -f /vault/secrets/processing-postgresql ] && . /vault/secrets/processing-postgresql - [ -f /vault/secrets/processing-jwt-public ] && export PUBLIC_KEY="$(cat /vault/secrets/processing-jwt-public)" - set +a - exec /httpserver migrate - ports: - - name: http - containerPort: 8080 - protocol: TCP - env: - - name: POSTGRES_POOL_SIZE - value: "3" - - name: HTTP_HOST - value: 0.0.0.0:8080 - - name: DJANGO_HOST - value: http://backend-svc.django.svc.cluster.local:80 - - name: S3_SERVICE_ACCOUNT - value: /etc/sarex/yc-s3/yc-s3-service-account.json - - name: ENABLE_SQL_QUERY - value: "0" - - name: POSTGRES_SSL_USE - value: "0" - resources: - requests: - cpu: "25m" - memory: 128Mi - imagePullSecrets: - - name: regcred diff --git a/apps/processing/base/api-service.yaml b/apps/processing/base/api-service.yaml deleted file mode 100644 index 3c2cbdd..0000000 --- a/apps/processing/base/api-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: backend-svc - namespace: processing -spec: - type: ClusterIP - selector: - app: workflows-api - ports: - - name: http - port: 80 - targetPort: 8080 - protocol: TCP diff --git a/apps/processing/base/api.yaml b/apps/processing/base/api.yaml new file mode 100644 index 0000000..fbfd678 --- /dev/null +++ b/apps/processing/base/api.yaml @@ -0,0 +1,160 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: workflows-api + namespace: processing + +spec: + interval: 10m + + chart: + spec: + chart: universal-chart + version: "0.1.9" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + + values: + global: + env: _default + + services: + backend: + enabled: true + + serviceAccount: + enabled: + _default: true + name: + _default: processing-vault + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/workflows-api_prod:075fc0 + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: workflows-api + + replicaCount: + _default: 1 + + port: + _default: 8080 + + command: + _default: ["/bin/bash", "-ec"] + args: + _default: + - | + set -a + [ -f /vault/secrets/processing-postgresql ] && . /vault/secrets/processing-postgresql + [ -f /vault/secrets/processing-jwt-public ] && export PUBLIC_KEY="$(cat /vault/secrets/processing-jwt-public)" + set +a + exec /httpserver migrate + + resources: + requests: + cpu: + _default: 25m + memory: + _default: 128Mi + + probes: + liveness: + enabled: false + readiness: + enabled: false + + service: + enabled: true + + name: + _default: backend-svc + + type: + _default: ClusterIP + + port: + _default: 80 + + targetPort: + _default: 8080 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: regcred + + envs: + - name: POSTGRES_POOL_SIZE + value: + _default: "3" + + - name: HTTP_HOST + value: + _default: "0.0.0.0:8080" + + - name: DJANGO_HOST + value: + _default: "http://backend-svc.django.svc.cluster.local:80" + + - name: S3_SERVICE_ACCOUNT + value: + _default: "/etc/sarex/yc-s3/yc-s3-service-account.json" + + - name: ENABLE_SQL_QUERY + value: + _default: "0" + + - name: POSTGRES_SSL_USE + value: + _default: "0" + + podAnnotations: + _default: + traffic.sidecar.istio.io/excludeOutboundPorts: "8200" + vault.hashicorp.com/agent-init-first: "true" + vault.hashicorp.com/agent-inject: "true" + vault.hashicorp.com/agent-pre-populate-only: "true" + vault.hashicorp.com/auth-path: auth/kubernetes + vault.hashicorp.com/role: processing + vault.hashicorp.com/agent-inject-secret-processing-postgresql: secrets/data/postgresql/apps/processing + vault.hashicorp.com/agent-inject-template-processing-postgresql: |- + {{- with secret "secrets/data/postgresql/apps/processing" -}} + POSTGRES_ADDRESS=postgresql.processing.svc.cluster.local + POSTGRES_PORT=5432 + POSTGRES_USER={{ index .Data.data "username" }} + POSTGRES_PASSWORD={{ index .Data.data "password" }} + POSTGRES_DB=workflow_db + {{- end -}} + vault.hashicorp.com/agent-inject-secret-processing-jwt-public: secrets/data/vault/common/rsa_keys + vault.hashicorp.com/agent-inject-template-processing-jwt-public: |- + {{- with secret "secrets/data/vault/common/rsa_keys" -}} + {{ index .Data.data "public_key" }} + {{- end -}} + + commitSha: "" + gitlabUri: "" + gitlabJobUrl: "" + owner: "" diff --git a/apps/processing/base/engine-low.yaml b/apps/processing/base/engine-low.yaml index 3e976cc..51d410b 100644 --- a/apps/processing/base/engine-low.yaml +++ b/apps/processing/base/engine-low.yaml @@ -1,218 +1,428 @@ --- -apiVersion: apps/v1 -kind: Deployment +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease metadata: name: engine-low namespace: processing - labels: - app: engine-low - service: engine-low -spec: - replicas: 1 - selector: - matchLabels: - app: engine-low - template: - metadata: - labels: - app: engine-low - service: engine-low - annotations: - traffic.sidecar.istio.io/excludeOutboundPorts: "8200" - vault.hashicorp.com/agent-init-first: "true" - vault.hashicorp.com/agent-inject: "true" - vault.hashicorp.com/agent-pre-populate-only: "true" - vault.hashicorp.com/auth-path: auth/kubernetes - vault.hashicorp.com/role: processing - vault.hashicorp.com/agent-inject-secret-processing-postgresql: secrets/data/postgresql/apps/processing - vault.hashicorp.com/agent-inject-template-processing-postgresql: |- - {{- with secret "secrets/data/postgresql/apps/processing" -}} - POSTGRES_ADDRESS=postgresql.processing.svc.cluster.local - POSTGRES_PORT=5432 - POSTGRES_USER={{ index .Data.data "username" }} - POSTGRES_PASSWORD={{ index .Data.data "password" }} - POSTGRES_DB=workflow_db - {{- end -}} - vault.hashicorp.com/agent-inject-secret-processing-rabbitmq: secrets/data/rabbitmq/apps/processing - vault.hashicorp.com/agent-inject-template-processing-rabbitmq: |- - {{- with secret "secrets/data/rabbitmq/apps/processing" -}} - RABBITMQ_HOST=rabbitmq.rabbitmq.svc.cluster.local - RABBITMQ_PORT=5672 - RABBITMQ_USER={{ index .Data.data "username" }} - RABBITMQ_PASS={{ index .Data.data "password" }} - {{- end -}} - vault.hashicorp.com/agent-inject-secret-processing-smtp: secrets/data/vault/common/smtp_auth - vault.hashicorp.com/agent-inject-template-processing-smtp: |- - {{- with secret "secrets/data/vault/common/smtp_auth" -}} - {{ index .Data.data "env_json" }} - {{- end -}} - spec: - serviceAccountName: processing-vault - containers: - - name: engine-low - image: cr.yandex/crp3ccidau046kdj8g9q/workflows-engine:contour_3ef5b462 - imagePullPolicy: IfNotPresent - command: ["/bin/bash", "-ec"] - args: - - | - set -a - [ -f /vault/secrets/processing-postgresql ] && . /vault/secrets/processing-postgresql - [ -f /vault/secrets/processing-rabbitmq ] && . /vault/secrets/processing-rabbitmq - set +a - exec /engine - ports: - - name: http - containerPort: 8000 - protocol: TCP - env: - - name: POSTGRES_POOL_SIZE - value: "20" - - name: ENVIRONMENT - value: prod - - name: WORKFLOWS_SENTRY_DSN - value: https://866b532efdbb4764a7551b76231232fc@o279218.ingest.sentry.io/543123 - - name: WORKFLOWS_SENTRY_DEBUG - value: "0" - - name: API_ADDRESS - value: 0.0.0.0:8000 - - name: DJANGO_HOST - value: http://backend.django.svc.cluster.local:8000 - - name: S3_SERVICE_ACCOUNT - value: /etc/sarex/yc-s3/yc-s3-service-account.json - - name: BIM_API_V2_DB - value: /etc/sarex/bim-api-v2-db-prod.json - - name: PDM_API_DB - value: /etc/pdm/pdm-api-db-prod.json - - name: WORKSPACE_API_DB - value: /etc/ws/ws-api-db-prod.json - - name: ISSUE_API_DB - value: /etc/issues/issue-api-db-prod.json - - name: MAILGUN - value: /etc/mailgun-secret/env.json - - name: SMTP - value: /vault/secrets/processing-smtp - - name: INTERNAL_PDM_URL - value: http://documentations-api.documentations.svc.cluster.local:8080 - - name: INTERNAL_FILESTREAM_URL - value: http://documentations-filestream.documentations.svc.cluster.local:8080 - - name: EXTERNAL_PDM_URL - value: http://documentations-api.documentations.svc.cluster.local:8080 - - name: EXTERNAL_FILESTREAM_URL - value: http://documentations-filestream-service.documentations.svc.cluster.local:8080 - - name: RESOURCES_API_INTERNAL_HOST - value: http://resources-service.resources.svc.cluster.local:8000 - - name: ENABLE_SQL_QUERY - value: "0" - - name: ENABLE_S3_STORAGE - value: "1" - - name: ENABLE_S3V2_STORAGE - value: "1" - - name: ENABLE_PDM_STORAGE - value: "1" - - name: ENABLE_SMTP - value: "1" - - name: ENABLE_URL_STORAGE - value: "1" - - name: ENABLE_SRX_TMP - value: "1" - - name: ENABLE_BIM_API_V2_DB - value: "1" - - name: ENABLE_WORKSPACE_API_DB - value: "1" - - name: ENABLE_ISSUE_API_DB - value: "1" - - name: ENABLE_RESOURCES_API - value: "1" - - name: VAULT_USE - value: "true" - - name: ENABLE_PDM_API_DB - value: "1" - - name: ENABLE_COMPARISONS_API_DB - value: "1" - - name: ENABLE_MAIL_GUN - value: "1" - - name: ENABLE_AMQP_EXECUTOR - value: "0" - - name: ENABLE_KUBERNETES_EXECUTOR - value: "1" - - name: MAX_WORKFLOWS_LIMIT - value: "5" - - name: CPU_COUNT - value: "1" - - name: MEMORY_GI - value: "1" - - name: CPU_COUNT_LOW_RESOURCES - value: "1" - - name: MEMORY_GI_LOW_RESOURCES - value: "1" - - name: CPU_COUNT_HIGH_MEM - value: "1" - - name: MEMORY_GI_HIGH_MEM - value: "1" - - name: COUNT_RUNNING_WORKERS - value: "1" - - name: COUNT_CANCELING_WORKERS - value: "1" - - name: COUNT_HANDLE_JOB_WORKERS - value: "1" - - name: BIM_API_DEBUG - value: "0" - - name: BIM_API_V2_DEBUG - value: "0" - - name: PDM_API_DEBUG - value: "0" - - name: COMPARISONS_API_DEBUG - value: "0" - - name: WORKSPACE_API_DEBUG - value: "0" - - name: JOBS_NAMESPACE - value: processing - - name: ISSUE_API_DEBUG - value: "0" - - name: TOLERATION_KEY - value: dedicated - - name: TOLERATION_VALUE - value: processing - - name: TOLERATION_KEY_HIGH_MEM - value: dedicated - - name: TOLERATION_VALUE_HIGH_MEM - value: processing - - name: TOLERATION_KEY_PERSISTENT - value: dedicated - - name: TOLERATION_VALUE_PERSISTENT - value: processing - - name: RABBITMQ_CREATE_EXCHANGE - value: autodesk.inputMessage - - name: RABBITMQ_CANCEL_EXCHANGE - value: autodesk.cancelMessage - - name: RABBITMQ_CREATE_ROUTING_KEY - value: converting - - name: RABBITMQ_CANCEL_TOPIC - value: cancel - - name: RABBITMQ_COMPLETENESS_EXCHANGE - value: autodesk.outputMessage - - name: RABBITMQ_COMPLETENESS_TOPIC - value: output_navis - - name: CONTROL_PLANE_PERIOD - value: 10s - - name: WORKFLOW_PRIORITY - value: low - - name: ENABLE_TOLERATION - value: "1" - - name: DEFAULT_TOLERATION_KEY - value: dedicated - - name: DEFAULT_TOLERATION_VALUE - value: processing - - name: DEFAULT_NODE_SELECTOR_KEY - value: dedicated - - name: DEFAULT_NODE_SELECTOR_VALUE - value: processing +spec: + interval: 10m + + chart: + spec: + chart: universal-chart + version: "0.1.9" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + + values: + global: + env: _default + + services: + backend: + enabled: true + + serviceAccount: + enabled: + _default: true + name: + _default: processing-vault + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/workflows-engine:contour_3ef5b462 + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: engine-low + + replicaCount: + _default: 1 + + port: + _default: 8000 + + command: + _default: ["/bin/bash", "-ec"] + args: + _default: + - | + set -a + [ -f /vault/secrets/processing-postgresql ] && . /vault/secrets/processing-postgresql + [ -f /vault/secrets/processing-rabbitmq ] && . /vault/secrets/processing-rabbitmq + set +a + exec /engine resources: requests: - cpu: "25m" - memory: 128Mi + cpu: + _default: 25m + memory: + _default: 128Mi - imagePullSecrets: - - name: regcred + probes: + liveness: + enabled: false + readiness: + enabled: false + + service: + enabled: false + + name: + _default: engine-low-svc + + type: + _default: ClusterIP + + port: + _default: 8000 + + targetPort: + _default: 8000 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: regcred + + envs: + - name: POSTGRES_POOL_SIZE + value: + _default: "20" + + - name: ENVIRONMENT + value: + _default: "prod" + + - name: WORKFLOWS_SENTRY_DSN + value: + _default: "https://866b532efdbb4764a7551b76231232fc@o279218.ingest.sentry.io/543123" + + - name: WORKFLOWS_SENTRY_DEBUG + value: + _default: "0" + + - name: API_ADDRESS + value: + _default: "0.0.0.0:8000" + + - name: DJANGO_HOST + value: + _default: "http://backend.django.svc.cluster.local:8000" + + - name: S3_SERVICE_ACCOUNT + value: + _default: "/etc/sarex/yc-s3/yc-s3-service-account.json" + + - name: BIM_API_V2_DB + value: + _default: "/etc/sarex/bim-api-v2-db-prod.json" + + - name: PDM_API_DB + value: + _default: "/etc/pdm/pdm-api-db-prod.json" + + - name: WORKSPACE_API_DB + value: + _default: "/etc/ws/ws-api-db-prod.json" + + - name: ISSUE_API_DB + value: + _default: "/etc/issues/issue-api-db-prod.json" + + - name: MAILGUN + value: + _default: "/etc/mailgun-secret/env.json" + + - name: SMTP + value: + _default: "/vault/secrets/processing-smtp" + + - name: INTERNAL_PDM_URL + value: + _default: "http://documentations-api.documentations.svc.cluster.local:8080" + + - name: INTERNAL_FILESTREAM_URL + value: + _default: "http://documentations-filestream.documentations.svc.cluster.local:8080" + + - name: EXTERNAL_PDM_URL + value: + _default: "http://documentations-api.documentations.svc.cluster.local:8080" + + - name: EXTERNAL_FILESTREAM_URL + value: + _default: "http://documentations-filestream-service.documentations.svc.cluster.local:8080" + + - name: RESOURCES_API_INTERNAL_HOST + value: + _default: "http://resources-service.resources.svc.cluster.local:8000" + + - name: ENABLE_SQL_QUERY + value: + _default: "0" + + - name: ENABLE_S3_STORAGE + value: + _default: "1" + + - name: ENABLE_S3V2_STORAGE + value: + _default: "1" + + - name: ENABLE_PDM_STORAGE + value: + _default: "1" + + - name: ENABLE_SMTP + value: + _default: "1" + + - name: ENABLE_URL_STORAGE + value: + _default: "1" + + - name: ENABLE_SRX_TMP + value: + _default: "1" + + - name: ENABLE_BIM_API_V2_DB + value: + _default: "1" + + - name: ENABLE_WORKSPACE_API_DB + value: + _default: "1" + + - name: ENABLE_ISSUE_API_DB + value: + _default: "1" + + - name: ENABLE_RESOURCES_API + value: + _default: "1" + + - name: VAULT_USE + value: + _default: "true" + + - name: ENABLE_PDM_API_DB + value: + _default: "1" + + - name: ENABLE_COMPARISONS_API_DB + value: + _default: "1" + + - name: ENABLE_MAIL_GUN + value: + _default: "1" + + - name: ENABLE_AMQP_EXECUTOR + value: + _default: "0" + + - name: ENABLE_KUBERNETES_EXECUTOR + value: + _default: "1" + + - name: MAX_WORKFLOWS_LIMIT + value: + _default: "5" + + - name: CPU_COUNT + value: + _default: "1" + + - name: MEMORY_GI + value: + _default: "1" + + - name: CPU_COUNT_LOW_RESOURCES + value: + _default: "1" + + - name: MEMORY_GI_LOW_RESOURCES + value: + _default: "1" + + - name: CPU_COUNT_HIGH_MEM + value: + _default: "1" + + - name: MEMORY_GI_HIGH_MEM + value: + _default: "1" + + - name: COUNT_RUNNING_WORKERS + value: + _default: "1" + + - name: COUNT_CANCELING_WORKERS + value: + _default: "1" + + - name: COUNT_HANDLE_JOB_WORKERS + value: + _default: "1" + + - name: BIM_API_DEBUG + value: + _default: "0" + + - name: BIM_API_V2_DEBUG + value: + _default: "0" + + - name: PDM_API_DEBUG + value: + _default: "0" + + - name: COMPARISONS_API_DEBUG + value: + _default: "0" + + - name: WORKSPACE_API_DEBUG + value: + _default: "0" + + - name: JOBS_NAMESPACE + value: + _default: "processing" + + - name: ISSUE_API_DEBUG + value: + _default: "0" + + - name: TOLERATION_KEY + value: + _default: "dedicated" + + - name: TOLERATION_VALUE + value: + _default: "processing" + + - name: TOLERATION_KEY_HIGH_MEM + value: + _default: "dedicated" + + - name: TOLERATION_VALUE_HIGH_MEM + value: + _default: "processing" + + - name: TOLERATION_KEY_PERSISTENT + value: + _default: "dedicated" + + - name: TOLERATION_VALUE_PERSISTENT + value: + _default: "processing" + + - name: RABBITMQ_CREATE_EXCHANGE + value: + _default: "autodesk.inputMessage" + + - name: RABBITMQ_CANCEL_EXCHANGE + value: + _default: "autodesk.cancelMessage" + + - name: RABBITMQ_CREATE_ROUTING_KEY + value: + _default: "converting" + + - name: RABBITMQ_CANCEL_TOPIC + value: + _default: "cancel" + + - name: RABBITMQ_COMPLETENESS_EXCHANGE + value: + _default: "autodesk.outputMessage" + + - name: RABBITMQ_COMPLETENESS_TOPIC + value: + _default: "output_navis" + + - name: CONTROL_PLANE_PERIOD + value: + _default: "10s" + + - name: WORKFLOW_PRIORITY + value: + _default: "low" + + - name: ENABLE_TOLERATION + value: + _default: "1" + + - name: DEFAULT_TOLERATION_KEY + value: + _default: "dedicated" + + - name: DEFAULT_TOLERATION_VALUE + value: + _default: "processing" + + - name: DEFAULT_NODE_SELECTOR_KEY + value: + _default: "dedicated" + + - name: DEFAULT_NODE_SELECTOR_VALUE + value: + _default: "processing" + + podAnnotations: + _default: + traffic.sidecar.istio.io/excludeOutboundPorts: "8200" + vault.hashicorp.com/agent-init-first: "true" + vault.hashicorp.com/agent-inject: "true" + vault.hashicorp.com/agent-pre-populate-only: "true" + vault.hashicorp.com/auth-path: auth/kubernetes + vault.hashicorp.com/role: processing + vault.hashicorp.com/agent-inject-secret-processing-postgresql: secrets/data/postgresql/apps/processing + vault.hashicorp.com/agent-inject-template-processing-postgresql: |- + {{- with secret "secrets/data/postgresql/apps/processing" -}} + POSTGRES_ADDRESS=postgresql.processing.svc.cluster.local + POSTGRES_PORT=5432 + POSTGRES_USER={{ index .Data.data "username" }} + POSTGRES_PASSWORD={{ index .Data.data "password" }} + POSTGRES_DB=workflow_db + {{- end -}} + vault.hashicorp.com/agent-inject-secret-processing-rabbitmq: secrets/data/rabbitmq/apps/processing + vault.hashicorp.com/agent-inject-template-processing-rabbitmq: |- + {{- with secret "secrets/data/rabbitmq/apps/processing" -}} + RABBITMQ_HOST=rabbitmq.rabbitmq.svc.cluster.local + RABBITMQ_PORT=5672 + RABBITMQ_USER={{ index .Data.data "username" }} + RABBITMQ_PASS={{ index .Data.data "password" }} + {{- end -}} + vault.hashicorp.com/agent-inject-secret-processing-smtp: secrets/data/vault/common/smtp_auth + vault.hashicorp.com/agent-inject-template-processing-smtp: |- + {{- with secret "secrets/data/vault/common/smtp_auth" -}} + {{ index .Data.data "env_json" }} + {{- end -}} + + commitSha: "" + gitlabUri: "" + gitlabJobUrl: "" + owner: "" diff --git a/apps/processing/base/engine.yaml b/apps/processing/base/engine.yaml index 6c69e24..5916e90 100644 --- a/apps/processing/base/engine.yaml +++ b/apps/processing/base/engine.yaml @@ -1,216 +1,420 @@ --- -apiVersion: apps/v1 -kind: Deployment +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease metadata: name: engine namespace: processing - labels: - app: engine - service: engine + spec: - replicas: 0 - selector: - matchLabels: - app: engine - template: - metadata: - labels: - app: engine - service: engine - annotations: - traffic.sidecar.istio.io/excludeOutboundPorts: "8200" - vault.hashicorp.com/agent-init-first: "true" - vault.hashicorp.com/agent-inject: "true" - vault.hashicorp.com/agent-pre-populate-only: "true" - vault.hashicorp.com/auth-path: auth/kubernetes - vault.hashicorp.com/role: processing - vault.hashicorp.com/agent-inject-secret-processing-postgresql: secrets/data/postgresql/apps/processing - vault.hashicorp.com/agent-inject-template-processing-postgresql: |- - {{- with secret "secrets/data/postgresql/apps/processing" -}} - POSTGRES_ADDRESS=postgresql.processing.svc.cluster.local - POSTGRES_PORT=5432 - POSTGRES_USER={{ index .Data.data "username" }} - POSTGRES_PASSWORD={{ index .Data.data "password" }} - POSTGRES_DB=workflow_db - {{- end -}} - vault.hashicorp.com/agent-inject-secret-processing-rabbitmq: secrets/data/rabbitmq/apps/processing - vault.hashicorp.com/agent-inject-template-processing-rabbitmq: |- - {{- with secret "secrets/data/rabbitmq/apps/processing" -}} - RABBITMQ_HOST=rabbitmq.rabbitmq.svc.cluster.local - RABBITMQ_PORT=5672 - RABBITMQ_USER={{ index .Data.data "username" }} - RABBITMQ_PASS={{ index .Data.data "password" }} - {{- end -}} - vault.hashicorp.com/agent-inject-secret-processing-smtp: secrets/data/vault/common/smtp_auth - vault.hashicorp.com/agent-inject-template-processing-smtp: |- - {{- with secret "secrets/data/vault/common/smtp_auth" -}} - {{ index .Data.data "env_json" }} - {{- end -}} + interval: 10m + + chart: spec: - serviceAccountName: processing-vault + chart: universal-chart + version: "0.1.9" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m - containers: - - name: engine - image: cr.yandex/crp3ccidau046kdj8g9q/workflows-endigne_prod:075fc0 - imagePullPolicy: IfNotPresent - command: ["/bin/bash", "-ec"] + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + + values: + global: + env: _default + + services: + backend: + enabled: true + + serviceAccount: + enabled: + _default: true + name: + _default: processing-vault + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/workflows-endigne_prod:075fc0 + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: engine + + replicaCount: + _default: 0 + + port: + _default: 8000 + + command: + _default: ["/bin/bash", "-ec"] args: - - | - set -a - [ -f /vault/secrets/processing-postgresql ] && . /vault/secrets/processing-postgresql - [ -f /vault/secrets/processing-rabbitmq ] && . /vault/secrets/processing-rabbitmq - set +a - exec /engine - - ports: - - name: http - containerPort: 8000 - protocol: TCP - - env: - - name: POSTGRES_POOL_SIZE - value: "20" - - name: ENVIRONMENT - value: prod - - name: WORKFLOWS_SENTRY_DSN - value: https://866b532efdbb4764a7551b76231232fc@o279218.ingest.sentry.io/543123 - - name: WORKFLOWS_SENTRY_DEBUG - value: "0" - - name: API_ADDRESS - value: 0.0.0.0:8000 - - name: DJANGO_HOST - value: http://backend.django.svc.cluster.local:8000 - - name: S3_SERVICE_ACCOUNT - value: /etc/sarex/yc-s3/yc-s3-service-account.json - - name: BIM_API_V2_DB - value: /etc/sarex/bim-api-v2-db-prod.json - - name: PDM_API_DB - value: /etc/pdm/pdm-api-db-prod.json - - name: WORKSPACE_API_DB - value: /etc/ws/ws-api-db-prod.json - - name: ISSUE_API_DB - value: /etc/issues/issue-api-db-prod.json - - name: MAILGUN - value: /etc/mailgun-secret/env.json - - name: SMTP - value: /vault/secrets/processing-smtp - - name: INTERNAL_PDM_URL - value: http://documentations-api.documentations.svc.cluster.local:8080 - - name: INTERNAL_FILESTREAM_URL - value: http://documentations-filestream.documentations.svc.cluster.local:8080 - - name: EXTERNAL_PDM_URL - value: http://documentations-api.documentations.svc.cluster.local:8080 - - name: EXTERNAL_FILESTREAM_URL - value: http://documentations-filestream-service.documentations.svc.cluster.local:8080 - - name: RESOURCES_API_INTERNAL_HOST - value: http://resources-service.resources.svc.cluster.local:8000 - - name: ENABLE_SQL_QUERY - value: "0" - - name: ENABLE_S3_STORAGE - value: "1" - - name: ENABLE_S3V2_STORAGE - value: "1" - - name: ENABLE_PDM_STORAGE - value: "1" - - name: ENABLE_SMTP - value: "1" - - name: ENABLE_URL_STORAGE - value: "1" - - name: ENABLE_SRX_TMP - value: "1" - - name: ENABLE_BIM_API_V2_DB - value: "1" - - name: ENABLE_WORKSPACE_API_DB - value: "1" - - name: ENABLE_ISSUE_API_DB - value: "1" - - name: ENABLE_RESOURCES_API - value: "1" - - name: ENABLE_PDM_API_DB - value: "1" - - name: ENABLE_COMPARISONS_API_DB - value: "1" - - name: ENABLE_MAIL_GUN - value: "1" - - name: ENABLE_AMQP_EXECUTOR - value: "0" - - name: ENABLE_KUBERNETES_EXECUTOR - value: "1" - - name: MAX_WORKFLOWS_LIMIT - value: "5" - - name: CPU_COUNT - value: "1" - - name: MEMORY_GI - value: "1" - - name: CPU_COUNT_LOW_RESOURCES - value: "1" - - name: MEMORY_GI_LOW_RESOURCES - value: "1" - - name: CPU_COUNT_HIGH_MEM - value: "1" - - name: MEMORY_GI_HIGH_MEM - value: "1" - - name: ENABLE_TOLERATION - value: "1" - - name: COUNT_RUNNING_WORKERS - value: "1" - - name: COUNT_CANCELING_WORKERS - value: "1" - - name: COUNT_HANDLE_JOB_WORKERS - value: "1" - - name: BIM_API_DEBUG - value: "0" - - name: BIM_API_V2_DEBUG - value: "0" - - name: PDM_API_DEBUG - value: "0" - - name: COMPARISONS_API_DEBUG - value: "0" - - name: WORKSPACE_API_DEBUG - value: "0" - - name: JOBS_NAMESPACE - value: processing - - name: ISSUE_API_DEBUG - value: "0" - - name: TOLERATION_KEY - value: dedicated - - name: TOLERATION_VALUE - value: processing - - name: TOLERATION_KEY_HIGH_MEM - value: dedicated - - name: TOLERATION_VALUE_HIGH_MEM - value: processing - - name: TOLERATION_KEY_PERSISTENT - value: dedicated - - name: TOLERATION_VALUE_PERSISTENT - value: processing - - name: RABBITMQ_CREATE_EXCHANGE - value: autodesk.inputMessage - - name: RABBITMQ_CANCEL_EXCHANGE - value: autodesk.cancelMessage - - name: RABBITMQ_CREATE_ROUTING_KEY - value: converting - - name: RABBITMQ_CANCEL_TOPIC - value: cancel - - name: RABBITMQ_COMPLETENESS_EXCHANGE - value: autodesk.outputMessage - - name: RABBITMQ_COMPLETENESS_TOPIC - value: output_navis - - name: CONTROL_PLANE_PERIOD - value: 10s - - name: DEFAULT_TOLERATION_KEY - value: dedicated - - name: DEFAULT_TOLERATION_VALUE - value: processing - - name: DEFAULT_NODE_SELECTOR_KEY - value: dedicated - - name: DEFAULT_NODE_SELECTOR_VALUE - value: processing + _default: + - | + set -a + [ -f /vault/secrets/processing-postgresql ] && . /vault/secrets/processing-postgresql + [ -f /vault/secrets/processing-rabbitmq ] && . /vault/secrets/processing-rabbitmq + set +a + exec /engine resources: requests: - cpu: "25m" - memory: 128Mi + cpu: + _default: 25m + memory: + _default: 128Mi - imagePullSecrets: - - name: regcred + probes: + liveness: + enabled: false + readiness: + enabled: false + + service: + enabled: false + + name: + _default: engine-svc + + type: + _default: ClusterIP + + port: + _default: 8000 + + targetPort: + _default: 8000 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: regcred + + envs: + - name: POSTGRES_POOL_SIZE + value: + _default: "20" + + - name: ENVIRONMENT + value: + _default: "prod" + + - name: WORKFLOWS_SENTRY_DSN + value: + _default: "https://866b532efdbb4764a7551b76231232fc@o279218.ingest.sentry.io/543123" + + - name: WORKFLOWS_SENTRY_DEBUG + value: + _default: "0" + + - name: API_ADDRESS + value: + _default: "0.0.0.0:8000" + + - name: DJANGO_HOST + value: + _default: "http://backend.django.svc.cluster.local:8000" + + - name: S3_SERVICE_ACCOUNT + value: + _default: "/etc/sarex/yc-s3/yc-s3-service-account.json" + + - name: BIM_API_V2_DB + value: + _default: "/etc/sarex/bim-api-v2-db-prod.json" + + - name: PDM_API_DB + value: + _default: "/etc/pdm/pdm-api-db-prod.json" + + - name: WORKSPACE_API_DB + value: + _default: "/etc/ws/ws-api-db-prod.json" + + - name: ISSUE_API_DB + value: + _default: "/etc/issues/issue-api-db-prod.json" + + - name: MAILGUN + value: + _default: "/etc/mailgun-secret/env.json" + + - name: SMTP + value: + _default: "/vault/secrets/processing-smtp" + + - name: INTERNAL_PDM_URL + value: + _default: "http://documentations-api.documentations.svc.cluster.local:8080" + + - name: INTERNAL_FILESTREAM_URL + value: + _default: "http://documentations-filestream.documentations.svc.cluster.local:8080" + + - name: EXTERNAL_PDM_URL + value: + _default: "http://documentations-api.documentations.svc.cluster.local:8080" + + - name: EXTERNAL_FILESTREAM_URL + value: + _default: "http://documentations-filestream-service.documentations.svc.cluster.local:8080" + + - name: RESOURCES_API_INTERNAL_HOST + value: + _default: "http://resources-service.resources.svc.cluster.local:8000" + + - name: ENABLE_SQL_QUERY + value: + _default: "0" + + - name: ENABLE_S3_STORAGE + value: + _default: "1" + + - name: ENABLE_S3V2_STORAGE + value: + _default: "1" + + - name: ENABLE_PDM_STORAGE + value: + _default: "1" + + - name: ENABLE_SMTP + value: + _default: "1" + + - name: ENABLE_URL_STORAGE + value: + _default: "1" + + - name: ENABLE_SRX_TMP + value: + _default: "1" + + - name: ENABLE_BIM_API_V2_DB + value: + _default: "1" + + - name: ENABLE_WORKSPACE_API_DB + value: + _default: "1" + + - name: ENABLE_ISSUE_API_DB + value: + _default: "1" + + - name: ENABLE_RESOURCES_API + value: + _default: "1" + + - name: ENABLE_PDM_API_DB + value: + _default: "1" + + - name: ENABLE_COMPARISONS_API_DB + value: + _default: "1" + + - name: ENABLE_MAIL_GUN + value: + _default: "1" + + - name: ENABLE_AMQP_EXECUTOR + value: + _default: "0" + + - name: ENABLE_KUBERNETES_EXECUTOR + value: + _default: "1" + + - name: MAX_WORKFLOWS_LIMIT + value: + _default: "5" + + - name: CPU_COUNT + value: + _default: "1" + + - name: MEMORY_GI + value: + _default: "1" + + - name: CPU_COUNT_LOW_RESOURCES + value: + _default: "1" + + - name: MEMORY_GI_LOW_RESOURCES + value: + _default: "1" + + - name: CPU_COUNT_HIGH_MEM + value: + _default: "1" + + - name: MEMORY_GI_HIGH_MEM + value: + _default: "1" + + - name: ENABLE_TOLERATION + value: + _default: "1" + + - name: COUNT_RUNNING_WORKERS + value: + _default: "1" + + - name: COUNT_CANCELING_WORKERS + value: + _default: "1" + + - name: COUNT_HANDLE_JOB_WORKERS + value: + _default: "1" + + - name: BIM_API_DEBUG + value: + _default: "0" + + - name: BIM_API_V2_DEBUG + value: + _default: "0" + + - name: PDM_API_DEBUG + value: + _default: "0" + + - name: COMPARISONS_API_DEBUG + value: + _default: "0" + + - name: WORKSPACE_API_DEBUG + value: + _default: "0" + + - name: JOBS_NAMESPACE + value: + _default: "processing" + + - name: ISSUE_API_DEBUG + value: + _default: "0" + + - name: TOLERATION_KEY + value: + _default: "dedicated" + + - name: TOLERATION_VALUE + value: + _default: "processing" + + - name: TOLERATION_KEY_HIGH_MEM + value: + _default: "dedicated" + + - name: TOLERATION_VALUE_HIGH_MEM + value: + _default: "processing" + + - name: TOLERATION_KEY_PERSISTENT + value: + _default: "dedicated" + + - name: TOLERATION_VALUE_PERSISTENT + value: + _default: "processing" + + - name: RABBITMQ_CREATE_EXCHANGE + value: + _default: "autodesk.inputMessage" + + - name: RABBITMQ_CANCEL_EXCHANGE + value: + _default: "autodesk.cancelMessage" + + - name: RABBITMQ_CREATE_ROUTING_KEY + value: + _default: "converting" + + - name: RABBITMQ_CANCEL_TOPIC + value: + _default: "cancel" + + - name: RABBITMQ_COMPLETENESS_EXCHANGE + value: + _default: "autodesk.outputMessage" + + - name: RABBITMQ_COMPLETENESS_TOPIC + value: + _default: "output_navis" + + - name: CONTROL_PLANE_PERIOD + value: + _default: "10s" + + - name: DEFAULT_TOLERATION_KEY + value: + _default: "dedicated" + + - name: DEFAULT_TOLERATION_VALUE + value: + _default: "processing" + + - name: DEFAULT_NODE_SELECTOR_KEY + value: + _default: "dedicated" + + - name: DEFAULT_NODE_SELECTOR_VALUE + value: + _default: "processing" + + podAnnotations: + _default: + traffic.sidecar.istio.io/excludeOutboundPorts: "8200" + vault.hashicorp.com/agent-init-first: "true" + vault.hashicorp.com/agent-inject: "true" + vault.hashicorp.com/agent-pre-populate-only: "true" + vault.hashicorp.com/auth-path: auth/kubernetes + vault.hashicorp.com/role: processing + vault.hashicorp.com/agent-inject-secret-processing-postgresql: secrets/data/postgresql/apps/processing + vault.hashicorp.com/agent-inject-template-processing-postgresql: |- + {{- with secret "secrets/data/postgresql/apps/processing" -}} + POSTGRES_ADDRESS=postgresql.processing.svc.cluster.local + POSTGRES_PORT=5432 + POSTGRES_USER={{ index .Data.data "username" }} + POSTGRES_PASSWORD={{ index .Data.data "password" }} + POSTGRES_DB=workflow_db + {{- end -}} + vault.hashicorp.com/agent-inject-secret-processing-rabbitmq: secrets/data/rabbitmq/apps/processing + vault.hashicorp.com/agent-inject-template-processing-rabbitmq: |- + {{- with secret "secrets/data/rabbitmq/apps/processing" -}} + RABBITMQ_HOST=rabbitmq.rabbitmq.svc.cluster.local + RABBITMQ_PORT=5672 + RABBITMQ_USER={{ index .Data.data "username" }} + RABBITMQ_PASS={{ index .Data.data "password" }} + {{- end -}} + vault.hashicorp.com/agent-inject-secret-processing-smtp: secrets/data/vault/common/smtp_auth + vault.hashicorp.com/agent-inject-template-processing-smtp: |- + {{- with secret "secrets/data/vault/common/smtp_auth" -}} + {{ index .Data.data "env_json" }} + {{- end -}} + + commitSha: "" + gitlabUri: "" + gitlabJobUrl: "" + owner: "" diff --git a/apps/processing/base/frontend-deployment.yaml b/apps/processing/base/frontend-deployment.yaml deleted file mode 100644 index 81d77ec..0000000 --- a/apps/processing/base/frontend-deployment.yaml +++ /dev/null @@ -1,32 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: frontend - namespace: processing - labels: - app: frontend -spec: - replicas: 1 - selector: - matchLabels: - app: frontend - template: - metadata: - labels: - app: frontend - spec: - containers: - - name: frontend - image: cr.yandex/crp3ccidau046kdj8g9q/workflows-frontend:ugok2_85f6ce2c - imagePullPolicy: IfNotPresent - ports: - - name: http - containerPort: 8080 - protocol: TCP - resources: - requests: - cpu: 25m - memory: 100Mi - imagePullSecrets: - - name: regcred diff --git a/apps/processing/base/frontend-service.yaml b/apps/processing/base/frontend-service.yaml deleted file mode 100644 index 121d041..0000000 --- a/apps/processing/base/frontend-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: frontend-svc - namespace: processing -spec: - type: ClusterIP - selector: - app: frontend - ports: - - name: http - port: 80 - targetPort: 8080 - protocol: TCP diff --git a/apps/processing/base/frontend.yaml b/apps/processing/base/frontend.yaml new file mode 100644 index 0000000..ca73261 --- /dev/null +++ b/apps/processing/base/frontend.yaml @@ -0,0 +1,90 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: frontend + namespace: processing + +spec: + interval: 10m + + chart: + spec: + chart: universal-chart + version: "0.1.9" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + + values: + global: + env: _default + + services: + frontend: + enabled: true + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/workflows-frontend:ugok2_85f6ce2c + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: frontend + + replicaCount: + _default: 1 + + port: + _default: 8080 + + resources: + requests: + cpu: + _default: 25m + memory: + _default: 100Mi + + probes: + liveness: + enabled: false + readiness: + enabled: false + + service: + enabled: true + + name: + _default: frontend-svc + + type: + _default: ClusterIP + + port: + _default: 80 + + targetPort: + _default: 8080 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: regcred diff --git a/apps/processing/base/kustomization.yaml b/apps/processing/base/kustomization.yaml index 9b0fc07..b41abbe 100644 --- a/apps/processing/base/kustomization.yaml +++ b/apps/processing/base/kustomization.yaml @@ -4,10 +4,7 @@ kind: Kustomization namespace: processing resources: - namespace.yaml - - serviceaccount.yaml - - api-deployment.yaml + - api.yaml - engine-low.yaml - engine.yaml - - frontend-deployment.yaml - - api-service.yaml - - frontend-service.yaml + - frontend.yaml diff --git a/apps/processing/base/serviceaccount.yaml b/apps/processing/base/serviceaccount.yaml deleted file mode 100644 index c336a7f..0000000 --- a/apps/processing/base/serviceaccount.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: processing-vault - namespace: processing diff --git a/apps/projects/base/deployment.yaml b/apps/projects/base/deployment.yaml deleted file mode 100644 index f2f223e..0000000 --- a/apps/projects/base/deployment.yaml +++ /dev/null @@ -1,46 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: projects-frontend-static - namespace: projects - labels: - app: projects-frontend-static -spec: - replicas: 2 - selector: - matchLabels: - app: projects-frontend-static - template: - metadata: - labels: - app: projects-frontend-static - spec: - containers: - - name: projects-frontend-static - image: cr.yandex/crp3ccidau046kdj8g9q/project-frontend-app:wb_fd49eb19 - imagePullPolicy: IfNotPresent - ports: - - name: http - containerPort: 80 - protocol: TCP - livenessProbe: - httpGet: - path: /ping - port: 80 - initialDelaySeconds: 10 - periodSeconds: 60 - failureThreshold: 10 - readinessProbe: - httpGet: - path: /ping - port: 80 - initialDelaySeconds: 10 - periodSeconds: 30 - failureThreshold: 20 - resources: - requests: - cpu: 25m - memory: 100Mi - imagePullSecrets: - - name: regcred diff --git a/apps/projects/base/frontend.yaml b/apps/projects/base/frontend.yaml new file mode 100644 index 0000000..99decc8 --- /dev/null +++ b/apps/projects/base/frontend.yaml @@ -0,0 +1,118 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: frontend + namespace: projects + +spec: + interval: 10m + + chart: + spec: + chart: universal-chart + version: "0.1.9" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + + values: + global: + env: _default + + services: + frontend: + enabled: true + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/project-frontend-app:wb_fd49eb19 + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: projects-frontend-static + + replicaCount: + _default: 2 + + port: + _default: 80 + + resources: + requests: + cpu: + _default: 25m + memory: + _default: 100Mi + + probes: + liveness: + enabled: + _default: true + type: + _default: httpGet + httpGet: + path: + _default: /ping + port: + _default: 80 + initialDelaySeconds: + _default: 10 + periodSeconds: + _default: 60 + failureThreshold: + _default: 10 + readiness: + enabled: + _default: true + type: + _default: httpGet + httpGet: + path: + _default: /ping + port: + _default: 80 + initialDelaySeconds: + _default: 10 + periodSeconds: + _default: 30 + failureThreshold: + _default: 20 + + service: + enabled: true + + name: + _default: projects-frontend-static-service + + type: + _default: ClusterIP + + port: + _default: 80 + + targetPort: + _default: 80 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: regcred diff --git a/apps/projects/base/kustomization.yaml b/apps/projects/base/kustomization.yaml index 2362307..2720a1c 100644 --- a/apps/projects/base/kustomization.yaml +++ b/apps/projects/base/kustomization.yaml @@ -4,5 +4,4 @@ kind: Kustomization namespace: projects resources: - namespace.yaml - - deployment.yaml - - service.yaml + - frontend.yaml diff --git a/apps/projects/base/service.yaml b/apps/projects/base/service.yaml deleted file mode 100644 index 5abbc82..0000000 --- a/apps/projects/base/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: projects-frontend-static-service - namespace: projects -spec: - type: ClusterIP - selector: - app: projects-frontend-static - ports: - - name: http - port: 80 - targetPort: 80 - protocol: TCP diff --git a/apps/projects/dsinv/kustomization.yaml b/apps/projects/dsinv/kustomization.yaml index faaec4d..ce39754 100644 --- a/apps/projects/dsinv/kustomization.yaml +++ b/apps/projects/dsinv/kustomization.yaml @@ -7,5 +7,5 @@ resources: patches: - path: projects-frontend-static.yaml target: - kind: Deployment - name: projects-frontend-static + kind: HelmRelease + name: frontend diff --git a/apps/projects/dsinv/projects-frontend-static.yaml b/apps/projects/dsinv/projects-frontend-static.yaml index 345cd92..c5c6083 100644 --- a/apps/projects/dsinv/projects-frontend-static.yaml +++ b/apps/projects/dsinv/projects-frontend-static.yaml @@ -1,13 +1,17 @@ --- -apiVersion: apps/v1 -kind: Deployment +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease metadata: - name: projects-frontend-static + name: frontend namespace: projects spec: - replicas: 1 - template: - spec: - containers: - - name: projects-frontend-static - image: cr.yandex/crp3ccidau046kdj8g9q/projects-frontend-static:donstroi_front + values: + services: + frontend: + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/projects-frontend-static:donstroi_front + + deployment: + replicaCount: + _default: 1 diff --git a/apps/stamp-verification/base/deployment.yaml b/apps/stamp-verification/base/deployment.yaml deleted file mode 100644 index f602fa4..0000000 --- a/apps/stamp-verification/base/deployment.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: frontend - namespace: stamp-verification - labels: - app: frontend -spec: - replicas: 1 - selector: - matchLabels: - app: frontend - template: - metadata: - labels: - app: frontend - version: stable - spec: - containers: - - name: frontend - image: cr.yandex/crp3ccidau046kdj8g9q/stamp-verification-frontend:e11a8f90be462fc325ff99c8c35a8a418815c27b - imagePullPolicy: IfNotPresent - ports: - - name: http - containerPort: 80 - protocol: TCP - resources: - requests: - cpu: 25m - memory: 100Mi - imagePullSecrets: - - name: regcred diff --git a/apps/stamp-verification/base/frontend.yaml b/apps/stamp-verification/base/frontend.yaml new file mode 100644 index 0000000..48c11dd --- /dev/null +++ b/apps/stamp-verification/base/frontend.yaml @@ -0,0 +1,90 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: frontend + namespace: stamp-verification + +spec: + interval: 10m + + chart: + spec: + chart: universal-chart + version: "0.1.9" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + + values: + global: + env: _default + + services: + frontend: + enabled: true + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/stamp-verification-frontend:e11a8f90be462fc325ff99c8c35a8a418815c27b + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: frontend + + replicaCount: + _default: 1 + + port: + _default: 80 + + resources: + requests: + cpu: + _default: 25m + memory: + _default: 100Mi + + probes: + liveness: + enabled: false + readiness: + enabled: false + + service: + enabled: true + + name: + _default: frontend-service + + type: + _default: ClusterIP + + port: + _default: 80 + + targetPort: + _default: 80 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: regcred diff --git a/apps/stamp-verification/base/kustomization.yaml b/apps/stamp-verification/base/kustomization.yaml index 9549795..5620234 100644 --- a/apps/stamp-verification/base/kustomization.yaml +++ b/apps/stamp-verification/base/kustomization.yaml @@ -4,5 +4,4 @@ kind: Kustomization namespace: stamp-verification resources: - namespace.yaml - - deployment.yaml - - service.yaml + - frontend.yaml diff --git a/apps/stamp-verification/base/service.yaml b/apps/stamp-verification/base/service.yaml deleted file mode 100644 index cacabbd..0000000 --- a/apps/stamp-verification/base/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: frontend-service - namespace: stamp-verification -spec: - type: ClusterIP - selector: - app: frontend - ports: - - name: http - port: 80 - targetPort: 80 - protocol: TCP diff --git a/apps/system-log/base/api.yaml b/apps/system-log/base/api.yaml new file mode 100644 index 0000000..2e8c0f1 --- /dev/null +++ b/apps/system-log/base/api.yaml @@ -0,0 +1,204 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: api + namespace: system-log + +spec: + interval: 10m + + chart: + spec: + chart: universal-chart + version: "0.1.9" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + + values: + global: + env: _default + + services: + backend: + enabled: true + + serviceAccount: + enabled: + _default: true + name: + _default: system-log-vault + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/system-log_prod:075fc0 + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: api + + replicaCount: + _default: 1 + + port: + _default: 8000 + + command: + _default: ["/bin/bash", "-ec"] + args: + _default: + - | + set -a + [ -f /vault/secrets/system-log-postgresql ] && . /vault/secrets/system-log-postgresql + [ -f /vault/secrets/system-log-kafka ] && . /vault/secrets/system-log-kafka + set +a + exec /app + + resources: + requests: + cpu: + _default: 25m + memory: + _default: 128Mi + + probes: + liveness: + enabled: false + readiness: + enabled: false + + service: + enabled: true + + name: + _default: backend-svc + + type: + _default: ClusterIP + + port: + _default: 80 + + targetPort: + _default: 8000 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: regcred + + envs: + - name: KAFKA_ENABLE + value: + _default: "1" + + - name: KAFKA_USE_SSL + value: + _default: "0" + + - name: KAFKA_ENABLE_LOGGING + value: + _default: "0" + + - name: APP_NAME + value: + _default: "system_log" + + - name: APP_VERSION + value: + _default: "0.0.1" + + - name: LOG_LEVEL + value: + _default: "INFO" + + - name: HTTP_HOST + value: + _default: "0.0.0.0" + + - name: HTTP_PORT + value: + _default: "8000" + + - name: NAMESPACE + value: + _default: "system-log" + + - name: POSTGRES_POOL_SIZE + value: + _default: "3" + + - name: ENABLE_SSL + value: + _default: "0" + + - name: KAFKA_GROUP + value: + _default: "system-log-stage" + + - name: KAFKA_CLIENT_ID + value: + _default: "system-log-stage" + + - name: KAFKA_PEM_PATH + value: + _default: "/tmp" + + - name: KAFKA_TOPIC + value: + _default: "system-log.events" + + - name: DJANGO_HOST + value: + _default: "http://backend.django.svc.cluster.local:8000" + + podAnnotations: + _default: + traffic.sidecar.istio.io/excludeOutboundPorts: "8200" + vault.hashicorp.com/agent-init-first: "true" + vault.hashicorp.com/agent-inject: "true" + vault.hashicorp.com/agent-pre-populate-only: "true" + vault.hashicorp.com/auth-path: auth/kubernetes + vault.hashicorp.com/role: system-log + vault.hashicorp.com/agent-inject-secret-system-log-postgresql: secrets/data/postgresql/apps/system-log + vault.hashicorp.com/agent-inject-template-system-log-postgresql: |- + {{- with secret "secrets/data/postgresql/apps/system-log" -}} + POSTGRES_ADDRESS=postgresql.system-log.svc.cluster.local + POSTGRES_PORT=5432 + POSTGRES_DB=system_log_db + POSTGRES_USER={{ index .Data.data "username" }} + POSTGRES_PASSWORD={{ index .Data.data "password" }} + {{- end -}} + vault.hashicorp.com/agent-inject-secret-system-log-kafka: secrets/data/kafka/apps/system-log + vault.hashicorp.com/agent-inject-template-system-log-kafka: |- + {{- with secret "secrets/data/kafka/apps/system-log" -}} + KAFKA_USERNAME={{ index .Data.data "username" }} + KAFKA_PASSWORD={{ index .Data.data "password" }} + KAFKA_BROKERS={{ index .Data.data.auth "bootstrap_servers" }} + {{ $topics := index .Data.data "topics" }} + KAFKA_TOPIC={{ if gt (len $topics) 0 }}{{ index (index $topics 0) "name" }}{{ else }}system-log.events{{ end }} + {{- end -}} + + commitSha: "" + gitlabUri: "" + gitlabJobUrl: "" + owner: "" diff --git a/apps/system-log/base/backend-deployment.yaml b/apps/system-log/base/backend-deployment.yaml deleted file mode 100644 index b35155f..0000000 --- a/apps/system-log/base/backend-deployment.yaml +++ /dev/null @@ -1,102 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: api - namespace: system-log - labels: - app: api - service: api -spec: - replicas: 1 - selector: - matchLabels: - app: api - template: - metadata: - labels: - app: api - service: api - annotations: - traffic.sidecar.istio.io/excludeOutboundPorts: "8200" - vault.hashicorp.com/agent-init-first: "true" - vault.hashicorp.com/agent-inject: "true" - vault.hashicorp.com/agent-pre-populate-only: "true" - vault.hashicorp.com/auth-path: auth/kubernetes - vault.hashicorp.com/role: system-log - vault.hashicorp.com/agent-inject-secret-system-log-postgresql: secrets/data/postgresql/apps/system-log - vault.hashicorp.com/agent-inject-template-system-log-postgresql: |- - {{- with secret "secrets/data/postgresql/apps/system-log" -}} - POSTGRES_ADDRESS=postgresql.system-log.svc.cluster.local - POSTGRES_PORT=5432 - POSTGRES_DB=system_log_db - POSTGRES_USER={{ index .Data.data "username" }} - POSTGRES_PASSWORD={{ index .Data.data "password" }} - {{- end -}} - vault.hashicorp.com/agent-inject-secret-system-log-kafka: secrets/data/kafka/apps/system-log - vault.hashicorp.com/agent-inject-template-system-log-kafka: |- - {{- with secret "secrets/data/kafka/apps/system-log" -}} - KAFKA_USERNAME={{ index .Data.data "username" }} - KAFKA_PASSWORD={{ index .Data.data "password" }} - KAFKA_BROKERS={{ index .Data.data.auth "bootstrap_servers" }} - {{ $topics := index .Data.data "topics" }} - KAFKA_TOPIC={{ if gt (len $topics) 0 }}{{ index (index $topics 0) "name" }}{{ else }}system-log.events{{ end }} - {{- end -}} - spec: - serviceAccountName: system-log-vault - containers: - - name: api - image: cr.yandex/crp3ccidau046kdj8g9q/system-log_prod:075fc0 - imagePullPolicy: IfNotPresent - command: ["/bin/bash", "-ec"] - args: - - | - set -a - [ -f /vault/secrets/system-log-postgresql ] && . /vault/secrets/system-log-postgresql - [ -f /vault/secrets/system-log-kafka ] && . /vault/secrets/system-log-kafka - set +a - exec /app - ports: - - name: http - containerPort: 8000 - protocol: TCP - env: - - name: KAFKA_ENABLE - value: "1" - - name: KAFKA_USE_SSL - value: "0" - - name: KAFKA_ENABLE_LOGGING - value: "0" - - name: APP_NAME - value: system_log - - name: APP_VERSION - value: 0.0.1 - - name: LOG_LEVEL - value: INFO - - name: HTTP_HOST - value: 0.0.0.0 - - name: HTTP_PORT - value: "8000" - - name: NAMESPACE - value: system-log - - name: POSTGRES_POOL_SIZE - value: "3" - - name: ENABLE_SSL - value: "0" - - name: KAFKA_GROUP - value: system-log-stage - - name: KAFKA_CLIENT_ID - value: system-log-stage - - name: KAFKA_PEM_PATH - value: "/tmp" - - name: KAFKA_TOPIC - value: "system-log.events" - - name: DJANGO_HOST - value: http://backend.django.svc.cluster.local:8000 - - resources: - requests: - cpu: "25m" - memory: 128Mi - imagePullSecrets: - - name: regcred diff --git a/apps/system-log/base/backend-service.yaml b/apps/system-log/base/backend-service.yaml deleted file mode 100644 index 20d2004..0000000 --- a/apps/system-log/base/backend-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: backend-svc - namespace: system-log -spec: - type: ClusterIP - selector: - app: api - ports: - - name: http - port: 80 - targetPort: 8000 - protocol: TCP diff --git a/apps/system-log/base/kustomization.yaml b/apps/system-log/base/kustomization.yaml index c0cac04..e37c1ee 100644 --- a/apps/system-log/base/kustomization.yaml +++ b/apps/system-log/base/kustomization.yaml @@ -4,7 +4,5 @@ kind: Kustomization namespace: system-log resources: - namespace.yaml - - serviceaccount.yaml - - backend-deployment.yaml - - backend-service.yaml - - worker-deployment.yaml + - api.yaml + - worker.yaml diff --git a/apps/system-log/base/serviceaccount.yaml b/apps/system-log/base/serviceaccount.yaml deleted file mode 100644 index 2443657..0000000 --- a/apps/system-log/base/serviceaccount.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: system-log-vault - namespace: system-log diff --git a/apps/system-log/base/worker-deployment.yaml b/apps/system-log/base/worker-deployment.yaml deleted file mode 100644 index a0381a4..0000000 --- a/apps/system-log/base/worker-deployment.yaml +++ /dev/null @@ -1,87 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: worker - namespace: system-log - labels: - app: worker - service: worker -spec: - replicas: 1 - selector: - matchLabels: - app: worker - template: - metadata: - labels: - app: worker - service: worker - annotations: - traffic.sidecar.istio.io/excludeOutboundPorts: "8200" - vault.hashicorp.com/agent-init-first: "true" - vault.hashicorp.com/agent-inject: "true" - vault.hashicorp.com/agent-pre-populate-only: "true" - vault.hashicorp.com/auth-path: auth/kubernetes - vault.hashicorp.com/role: system-log - vault.hashicorp.com/agent-inject-secret-system-log-postgresql: secrets/data/postgresql/apps/system-log - vault.hashicorp.com/agent-inject-template-system-log-postgresql: |- - {{- with secret "secrets/data/postgresql/apps/system-log" -}} - POSTGRES_ADDRESS=postgresql.system-log.svc.cluster.local - POSTGRES_PORT=5432 - POSTGRES_DB=system_log_db - POSTGRES_USER={{ index .Data.data "username" }} - POSTGRES_PASSWORD={{ index .Data.data "password" }} - {{- end -}} - vault.hashicorp.com/agent-inject-secret-system-log-django-auth: secrets/data/vault/common/django_auth - vault.hashicorp.com/agent-inject-template-system-log-django-auth: |- - {{- with secret "secrets/data/vault/common/django_auth" -}} - SUPER_USERNAME={{ index .Data.data "username" }} - SUPER_PASSWORD={{ index .Data.data "password" }} - {{- end -}} - spec: - serviceAccountName: system-log-vault - containers: - - name: worker - image: cr.yandex/crp3ccidau046kdj8g9q/system-log-worker_prod:075fc0 - imagePullPolicy: IfNotPresent - command: ["/bin/bash", "-ec"] - args: - - | - set -a - [ -f /vault/secrets/system-log-postgresql ] && . /vault/secrets/system-log-postgresql - [ -f /vault/secrets/system-log-django-auth ] && . /vault/secrets/system-log-django-auth - set +a - exec /app - ports: - - name: http - containerPort: 8000 - protocol: TCP - env: - - name: APP_NAME - value: system_log - - name: APP_VERSION - value: 0.0.1 - - name: LOG_LEVEL - value: INFO - - name: HTTP_HOST - value: 0.0.0.0 - - name: HTTP_PORT - value: "8000" - - name: NAMESPACE - value: sarex-system-log - - name: DOCUMENTATIONS_URL - value: http://documentations-api.documentations.svc.cluster.local:8080 - - name: POSTGRES_POOL_SIZE - value: "3" - - name: ENABLE_SSL - value: "0" - - name: DJANGO_HOST - value: http://backend.django.svc.cluster.local:8000 - - resources: - requests: - cpu: "25m" - memory: 128Mi - imagePullSecrets: - - name: regcred diff --git a/apps/system-log/base/worker.yaml b/apps/system-log/base/worker.yaml new file mode 100644 index 0000000..a1c32e7 --- /dev/null +++ b/apps/system-log/base/worker.yaml @@ -0,0 +1,177 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: worker + namespace: system-log + +spec: + interval: 10m + + chart: + spec: + chart: universal-chart + version: "0.1.9" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m + + install: + remediation: + retries: 3 + + upgrade: + remediation: + retries: 3 + + values: + global: + env: _default + + services: + backend: + enabled: true + + serviceAccount: + enabled: + _default: true + name: + _default: system-log-vault + + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/system-log-worker_prod:075fc0 + pullPolicy: + _default: IfNotPresent + + deployment: + enabled: true + + name: + _default: worker + + replicaCount: + _default: 1 + + port: + _default: 8000 + + command: + _default: ["/bin/bash", "-ec"] + args: + _default: + - | + set -a + [ -f /vault/secrets/system-log-postgresql ] && . /vault/secrets/system-log-postgresql + [ -f /vault/secrets/system-log-django-auth ] && . /vault/secrets/system-log-django-auth + set +a + exec /app + + resources: + requests: + cpu: + _default: 25m + memory: + _default: 128Mi + + probes: + liveness: + enabled: false + readiness: + enabled: false + + service: + enabled: false + + name: + _default: worker-svc + + type: + _default: ClusterIP + + port: + _default: 8000 + + targetPort: + _default: 8000 + + portName: + _default: http + + imagePullSecrets: + enabled: + _default: true + name: + _default: regcred + + envs: + - name: APP_NAME + value: + _default: "system_log" + + - name: APP_VERSION + value: + _default: "0.0.1" + + - name: LOG_LEVEL + value: + _default: "INFO" + + - name: HTTP_HOST + value: + _default: "0.0.0.0" + + - name: HTTP_PORT + value: + _default: "8000" + + - name: NAMESPACE + value: + _default: "sarex-system-log" + + - name: DOCUMENTATIONS_URL + value: + _default: "http://documentations-api.documentations.svc.cluster.local:8080" + + - name: POSTGRES_POOL_SIZE + value: + _default: "3" + + - name: ENABLE_SSL + value: + _default: "0" + + - name: DJANGO_HOST + value: + _default: "http://backend.django.svc.cluster.local:8000" + + podAnnotations: + _default: + traffic.sidecar.istio.io/excludeOutboundPorts: "8200" + vault.hashicorp.com/agent-init-first: "true" + vault.hashicorp.com/agent-inject: "true" + vault.hashicorp.com/agent-pre-populate-only: "true" + vault.hashicorp.com/auth-path: auth/kubernetes + vault.hashicorp.com/role: system-log + vault.hashicorp.com/agent-inject-secret-system-log-postgresql: secrets/data/postgresql/apps/system-log + vault.hashicorp.com/agent-inject-template-system-log-postgresql: |- + {{- with secret "secrets/data/postgresql/apps/system-log" -}} + POSTGRES_ADDRESS=postgresql.system-log.svc.cluster.local + POSTGRES_PORT=5432 + POSTGRES_DB=system_log_db + POSTGRES_USER={{ index .Data.data "username" }} + POSTGRES_PASSWORD={{ index .Data.data "password" }} + {{- end -}} + vault.hashicorp.com/agent-inject-secret-system-log-django-auth: secrets/data/vault/common/django_auth + vault.hashicorp.com/agent-inject-template-system-log-django-auth: |- + {{- with secret "secrets/data/vault/common/django_auth" -}} + SUPER_USERNAME={{ index .Data.data "username" }} + SUPER_PASSWORD={{ index .Data.data "password" }} + {{- end -}} + + commitSha: "" + gitlabUri: "" + gitlabJobUrl: "" + owner: "" diff --git a/apps/system-log/dsinv/api.yaml b/apps/system-log/dsinv/api.yaml index 4e5cc7d..6ad4ee1 100644 --- a/apps/system-log/dsinv/api.yaml +++ b/apps/system-log/dsinv/api.yaml @@ -1,59 +1,106 @@ --- -apiVersion: apps/v1 -kind: Deployment +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease metadata: name: api namespace: system-log spec: - template: - spec: - containers: - - name: api - image: cr.yandex/crp3ccidau046kdj8g9q/system-log:prod_6ed1b27e - env: - - name: KAFKA_PEM_CERT - value: mock - - name: KAFKA_PEM_PATH - value: local - - name: KAFKA_ENABLE_LOGGING - value: '0' - - name: KAFKA_USE_SSL - value: '0' - - name: KAFKA_TOPIC - value: mock - - name: KAFKA_PASSWORD - value: mock - - name: KAFKA_USERNAME - value: mock - - name: KAFKA_CLIENT_ID - value: system-log-prod - - name: KAFKA_GROUP - value: system-log-prod - - name: KAFKA_ENABLE - value: '0' - - name: KAFKA_BROKERS - value: mock - - name: APP_NAME - value: system_log - - name: APP_VERSION - value: 0.0.1 - - name: LOG_LEVEL - value: INFO - - name: HTTP_HOST - value: 0.0.0.0 - - name: HTTP_PORT - value: '8000' - - name: NAMESPACE - value: system-log - - name: POSTGRES_ADDRESS - value: postgres-service - - name: POSTGRES_PORT - value: '5432' - - name: POSTGRES_DB - value: system_log - - name: POSTGRES_POOL_SIZE - value: '3' - - name: ENABLE_SSL - value: '0' - - name: DJANGO_HOST - value: http://backend.django.svc.cluster.local:8000 + values: + services: + backend: + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/system-log:prod_6ed1b27e + + envs: + - name: KAFKA_ENABLE + value: + _default: "0" + + - name: KAFKA_USE_SSL + value: + _default: "0" + + - name: KAFKA_ENABLE_LOGGING + value: + _default: "0" + + - name: APP_NAME + value: + _default: "system_log" + + - name: APP_VERSION + value: + _default: "0.0.1" + + - name: LOG_LEVEL + value: + _default: "INFO" + + - name: HTTP_HOST + value: + _default: "0.0.0.0" + + - name: HTTP_PORT + value: + _default: "8000" + + - name: NAMESPACE + value: + _default: "system-log" + + - name: POSTGRES_ADDRESS + value: + _default: "postgres-service" + + - name: POSTGRES_PORT + value: + _default: "5432" + + - name: POSTGRES_DB + value: + _default: "system_log" + + - name: POSTGRES_POOL_SIZE + value: + _default: "3" + + - name: ENABLE_SSL + value: + _default: "0" + + - name: KAFKA_GROUP + value: + _default: "system-log-prod" + + - name: KAFKA_CLIENT_ID + value: + _default: "system-log-prod" + + - name: KAFKA_PEM_PATH + value: + _default: "local" + + - name: KAFKA_PEM_CERT + value: + _default: "mock" + + - name: KAFKA_TOPIC + value: + _default: "mock" + + - name: KAFKA_USERNAME + value: + _default: "mock" + + - name: KAFKA_PASSWORD + value: + _default: "mock" + + - name: KAFKA_BROKERS + value: + _default: "mock" + + - name: DJANGO_HOST + value: + _default: "http://backend.django.svc.cluster.local:8000" diff --git a/apps/system-log/dsinv/kustomization.yaml b/apps/system-log/dsinv/kustomization.yaml index 82e7cbf..f905767 100644 --- a/apps/system-log/dsinv/kustomization.yaml +++ b/apps/system-log/dsinv/kustomization.yaml @@ -7,9 +7,9 @@ resources: patches: - path: api.yaml target: - kind: Deployment + kind: HelmRelease name: api - path: worker.yaml target: - kind: Deployment + kind: HelmRelease name: worker diff --git a/apps/system-log/dsinv/worker.yaml b/apps/system-log/dsinv/worker.yaml index 8bfba36..9adc57d 100644 --- a/apps/system-log/dsinv/worker.yaml +++ b/apps/system-log/dsinv/worker.yaml @@ -1,39 +1,66 @@ --- -apiVersion: apps/v1 -kind: Deployment +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease metadata: name: worker namespace: system-log spec: - template: - spec: - containers: - - name: worker - image: cr.yandex/crp3ccidau046kdj8g9q/system_log_worker:c32c2f279673d1b5baa872b9d27872b0f3cc71cf - env: - - name: APP_NAME - value: system_log - - name: APP_VERSION - value: 0.0.1 - - name: LOG_LEVEL - value: INFO - - name: HTTP_HOST - value: 0.0.0.0 - - name: HTTP_PORT - value: '8000' - - name: NAMESPACE - value: sarex-system-log - - name: DOCUMENTATIONS_URL - value: http://documentations-service.documentations.svc.cluster.local:8080 - - name: POSTGRES_ADDRESS - value: postgres-service - - name: POSTGRES_PORT - value: '5432' - - name: POSTGRES_DB - value: system_log - - name: POSTGRES_POOL_SIZE - value: '3' - - name: ENABLE_SSL - value: '0' - - name: DJANGO_HOST - value: http://backend.django.svc.cluster.local:8000 + values: + services: + backend: + image: + name: + _default: cr.yandex/crp3ccidau046kdj8g9q/system_log_worker:c32c2f279673d1b5baa872b9d27872b0f3cc71cf + + envs: + - name: APP_NAME + value: + _default: "system_log" + + - name: APP_VERSION + value: + _default: "0.0.1" + + - name: LOG_LEVEL + value: + _default: "INFO" + + - name: HTTP_HOST + value: + _default: "0.0.0.0" + + - name: HTTP_PORT + value: + _default: "8000" + + - name: NAMESPACE + value: + _default: "sarex-system-log" + + - name: DOCUMENTATIONS_URL + value: + _default: "http://documentations-service.documentations.svc.cluster.local:8080" + + - name: POSTGRES_ADDRESS + value: + _default: "postgres-service" + + - name: POSTGRES_PORT + value: + _default: "5432" + + - name: POSTGRES_DB + value: + _default: "system_log" + + - name: POSTGRES_POOL_SIZE + value: + _default: "3" + + - name: ENABLE_SSL + value: + _default: "0" + + - name: DJANGO_HOST + value: + _default: "http://backend.django.svc.cluster.local:8000"