From f27f119d759fd43197a1670917461aa96c17cd88 Mon Sep 17 00:00:00 2001 From: acies312 <47986068+acies312@users.noreply.github.com> Date: Mon, 19 Feb 2024 12:27:32 +0300 Subject: [PATCH] chart cleanup (#2922) --- .../application-kubernetes.properties | 1 + .../templates/backend-cosv-configmap.yaml | 19 --- .../templates/backend-cosv-deployment.yaml | 138 ------------------ .../templates/backend-cosv-service.yaml | 12 -- .../save-cloud/templates/backend-cosv.yaml | 30 ++-- .../save-cloud/templates/backend.yaml | 7 + .../templates/frontend-cosv-deployment.yaml | 30 ---- .../templates/frontend-cosv-service.yaml | 9 -- 8 files changed, 23 insertions(+), 223 deletions(-) delete mode 100644 save-cloud-charts/save-cloud/templates/backend-cosv-configmap.yaml delete mode 100644 save-cloud-charts/save-cloud/templates/backend-cosv-deployment.yaml delete mode 100644 save-cloud-charts/save-cloud/templates/backend-cosv-service.yaml delete mode 100644 save-cloud-charts/save-cloud/templates/frontend-cosv-deployment.yaml delete mode 100644 save-cloud-charts/save-cloud/templates/frontend-cosv-service.yaml diff --git a/api-gateway/src/main/resources/application-kubernetes.properties b/api-gateway/src/main/resources/application-kubernetes.properties index 4628a4eb19..aa0aac44db 100644 --- a/api-gateway/src/main/resources/application-kubernetes.properties +++ b/api-gateway/src/main/resources/application-kubernetes.properties @@ -1,6 +1,7 @@ gateway.backend.url=http://backend gateway.frontend.url=http://frontend gateway.demo-cpg.url=http://demo-cpg +gateway.frontend-cosv.url=http://frontend-cosv gateway.demo.url=http://demo server.shutdown=graceful management.endpoints.web.exposure.include=* diff --git a/save-cloud-charts/save-cloud/templates/backend-cosv-configmap.yaml b/save-cloud-charts/save-cloud/templates/backend-cosv-configmap.yaml deleted file mode 100644 index 5cde5a005d..0000000000 --- a/save-cloud-charts/save-cloud/templates/backend-cosv-configmap.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Values.backend_cosv.name }}-config -data: - application.properties: | - backend.preprocessor-url=http://preprocessor - backend.orchestrator-url=http://orchestrator - backend.demo-url=http://demo - backend.loki.url=http://loki:3100 - backend.loki.labels.agent-container-name=pod - backend.loki.labels.application-name=app - backend.agent-settings.backend-url=http://{{ .Values.backend_cosv.name }} - server.shutdown=graceful - management.endpoints.web.exposure.include=* - management.server.port={{ .Values.backend_cosv.managementPort }} - spring.datasource.url=${spring.datasource.backend-cosv-url} - logging.level.org.springframework=DEBUG - logging.level.com.saveourtool=DEBUG diff --git a/save-cloud-charts/save-cloud/templates/backend-cosv-deployment.yaml b/save-cloud-charts/save-cloud/templates/backend-cosv-deployment.yaml deleted file mode 100644 index 02f447ece5..0000000000 --- a/save-cloud-charts/save-cloud/templates/backend-cosv-deployment.yaml +++ /dev/null @@ -1,138 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: backend-cosv - labels: - {{- include "common.labels" (merge (dict "service" .Values.backend_cosv) .) | nindent 4 }} -spec: - selector: - matchLabels: - io.kompose.service: backend-cosv - strategy: - # Because of shared volume with multi-attach problem - type: Recreate - template: - metadata: - labels: - {{- include "pod.common.labels" (merge (dict "service" .Values.backend_cosv ) .) | nindent 8 }} - annotations: - {{- include "pod.common.annotations" (dict "service" .Values.backend_cosv ) | nindent 8 }} - spec: - restartPolicy: Always - {{- include "cnb.securityContext" . | nindent 6 }} - containers: - - name: backend-cosv - {{- include "spring-boot.common" (merge (dict "service" .Values.backend_cosv) .) | nindent 10 }} - env: - {{- include "spring-boot.common.env" (merge (dict "service" .Values.backend_cosv) .) | nindent 12 }} - - name: DATABASE_SECRETS_PATH - value: {{ .Values.mysql.dbPasswordFile }} - - name: S3_SECRETS_PATH - value: {{ .Values.s3.secretFile }} - - name: JAVA_TOOL_OPTIONS - value: -XX:ReservedCodeCacheSize=48M - volumeMounts: - - {{ include "spring-boot.config-volume-mount" . | indent 14 | trim }} - - name: database-secret - mountPath: {{ .Values.mysql.dbPasswordFile }} - - name: s3-secrets - mountPath: {{ .Values.s3.secretFile }} - {{- include "spring-boot.management" .Values.backend_cosv | nindent 10 }} - resources: - limits: - memory: 2G - requests: - memory: 1G - {{ if .Values.mysql.migrations.enabled }} - initContainers: - - name: git-cloner - image: alpine/git - env: - {{ if .Values.proxy.enabled | default false }} - {{- with .Values.proxy.extraEnv }} - {{- toYaml . | nindent 12 }} - {{- end }} - {{ end }} - args: - - clone - - --progress - - --verbose - {{ if .Values.proxy.enabled | default false }} - {{- with .Values.proxy.extraArgs }} - {{- toYaml . | nindent 12 }} - {{- end }} - {{ end }} - - --single-branch - - --branch - - {{ .Values.mysql.migrations.branch | default "master" }} - - -- - - https://github.com/saveourtool/save-cloud.git - - /data - volumeMounts: - - mountPath: /data - name: migrations-data - - name: liquibase-runner - image: liquibase/liquibase:4.20 - securityContext: - runAsUser: 1001 - runAsGroup: 1001 - args: - - --url=$(DB_URL)?createDatabaseIfNotExist=true - - --changeLogFile=db/db.changelog-master.xml - - --username=$(DB_USERNAME) - - --password=$(DB_PASSWORD) - - --log-level=info - - --contexts={{ .Values.profile }} - - update - resources: - requests: - memory: 100M - limits: - memory: 300M - env: - # See https://hub.docker.com/r/liquibase/liquibase, section 'Notice for MySQL Users' - - name: INSTALL_MYSQL - value: 'true' - - name: DB_URL - valueFrom: - secretKeyRef: - name: db-secrets - key: spring.datasource.backend-url - - name: DB_USERNAME - valueFrom: - secretKeyRef: - name: db-secrets - key: spring.datasource.username - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - name: db-secrets - key: spring.datasource.password - {{ if .Values.proxy.enabled | default false }} - {{- with .Values.proxy.extraEnv }} - {{- toYaml . | nindent 12 }} - {{- end }} - {{ end }} - volumeMounts: - - mountPath: /liquibase/changelog - name: migrations-data - - mountPath: {{ .Values.mysql.dbPasswordFile }} - name: database-secret - - mountPath: /etc/ssl/certs/ca-certificates.crt - name: ca-certs - subPath: cert-check.crt - readOnly: false - {{ end }} - volumes: - - {{ include "spring-boot.config-volume" (dict "service" .Values.backend_cosv) | indent 10 | trim }} - - name: database-secret - secret: - secretName: db-secrets - - name: s3-secrets - secret: - secretName: s3-secrets - - name: migrations-data - emptyDir: {} - - name: ca-certs - configMap: - name: ca-certs \ No newline at end of file diff --git a/save-cloud-charts/save-cloud/templates/backend-cosv-service.yaml b/save-cloud-charts/save-cloud/templates/backend-cosv-service.yaml deleted file mode 100644 index 3b91491acd..0000000000 --- a/save-cloud-charts/save-cloud/templates/backend-cosv-service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: -{{- include "service.common.metadata" (dict "service" .Values.backend_cosv) | nindent 2 }} -spec: - {{ if .Values.backend_cosv.clusterIP }} - clusterIP: {{ .Values.backend_cosv.clusterIP }} - {{ end }} - ports: - {{- include "service.common.ports" (dict "service" .Values.backend_cosv) | nindent 4 }} - selector: - {{- include "service.common.selectors" (dict "service" .Values.backend_cosv) | nindent 4 }} diff --git a/save-cloud-charts/save-cloud/templates/backend-cosv.yaml b/save-cloud-charts/save-cloud/templates/backend-cosv.yaml index 30aa3911d9..0f1154e422 100644 --- a/save-cloud-charts/save-cloud/templates/backend-cosv.yaml +++ b/save-cloud-charts/save-cloud/templates/backend-cosv.yaml @@ -117,9 +117,9 @@ spec: name: migrations-data - mountPath: {{ .Values.mysql.dbPasswordFile }} name: database-secret - - mountPath: /etc/ssl/certs/ca-certificates.crt - name: ca-certs - subPath: cert-check.crt + - name: ca-pemstore + mountPath: /etc/ssl/certs/ca-certificates.crt + subPath: ca-certificates.crt readOnly: false volumes: - {{ include "spring-boot.config-volume" (dict "service" .Values.backend_cosv) | indent 10 | trim }} @@ -131,9 +131,19 @@ spec: secretName: s3-secrets - name: migrations-data emptyDir: {} - - name: ca-certs + - name: ca-pemstore configMap: - name: ca-certs + name: ca-pemstore +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Values.backend_cosv.name }}-config +data: + application.properties: | + {{ if .Values.backend_cosv.applicationProperties }} + {{- .Values.backend_cosv.applicationProperties | nindent 4 }} + {{ end }} --- apiVersion: v1 kind: Service @@ -147,13 +157,3 @@ spec: {{- include "service.common.ports" (dict "service" .Values.backend_cosv) | nindent 4 }} selector: {{- include "service.common.selectors" (dict "service" .Values.backend_cosv) | nindent 4 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Values.backend_cosv.name }}-config -data: - application.properties: | - {{ if .Values.backend_cosv.applicationProperties }} - {{- .Values.backend_cosv.applicationProperties | nindent 4 }} - {{ end }} diff --git a/save-cloud-charts/save-cloud/templates/backend.yaml b/save-cloud-charts/save-cloud/templates/backend.yaml index 80a3149ae3..d159fa88e7 100644 --- a/save-cloud-charts/save-cloud/templates/backend.yaml +++ b/save-cloud-charts/save-cloud/templates/backend.yaml @@ -117,6 +117,10 @@ spec: name: migrations-data - mountPath: {{ .Values.mysql.dbPasswordFile }} name: database-secret + - name: ca-pemstore + mountPath: /etc/ssl/certs/ca-certificates.crt + subPath: ca-certificates.crt + readOnly: false volumes: - {{ include "spring-boot.config-volume" (dict "service" .Values.backend) | indent 10 | trim }} - name: database-secret @@ -127,6 +131,9 @@ spec: secretName: s3-secrets - name: migrations-data emptyDir: {} + - name: ca-pemstore + configMap: + name: ca-pemstore --- apiVersion: v1 kind: Service diff --git a/save-cloud-charts/save-cloud/templates/frontend-cosv-deployment.yaml b/save-cloud-charts/save-cloud/templates/frontend-cosv-deployment.yaml deleted file mode 100644 index 5689c1be8d..0000000000 --- a/save-cloud-charts/save-cloud/templates/frontend-cosv-deployment.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: frontend-cosv - labels: - {{- include "common.labels" (merge (dict "service" .Values.frontend_cosv) .) | nindent 4 }} -spec: - selector: - matchLabels: - io.kompose.service: frontend-cosv - strategy: - type: RollingUpdate - template: - metadata: - labels: - {{- include "pod.common.labels" (merge (dict "service" .Values.frontend_cosv ) .) | nindent 8 }} - spec: - restartPolicy: Always - {{- include "cnb.securityContext" . | nindent 6 }} - containers: - - name: frontend-cosv - {{- include "spring-boot.common" (merge (dict "service" .Values.frontend_cosv) .) | nindent 10 }} - env: - - name: PORT - value: '{{ .Values.frontend_cosv.containerPort | toString }}' - resources: - limits: - memory: 200M - requests: - memory: 100M \ No newline at end of file diff --git a/save-cloud-charts/save-cloud/templates/frontend-cosv-service.yaml b/save-cloud-charts/save-cloud/templates/frontend-cosv-service.yaml deleted file mode 100644 index 03927129bc..0000000000 --- a/save-cloud-charts/save-cloud/templates/frontend-cosv-service.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: -{{- include "service.common.metadata" (dict "service" .Values.frontend_cosv) | nindent 2 }} -spec: - ports: - {{- include "service.common.ports" (dict "service" .Values.frontend_cosv) | nindent 4 }} - selector: - {{- include "service.common.selectors" (dict "service" .Values.frontend_cosv) | nindent 4 }} \ No newline at end of file