From ea520d74779bb507381aae1fafda2edf242c02ef Mon Sep 17 00:00:00 2001 From: "fabio.d.mota" Date: Tue, 19 Sep 2023 10:00:01 +0100 Subject: [PATCH] feat(Cleaning): Add new workflow for cleaning service module on build --- .../bpdm-cleaning-service-dummy/Chart.yaml | 1 - .../templates/_helpers.tpl | 4 +- .../templates/configMap.yaml | 7 ++ .../templates/deployment.yaml | 74 +++++++++---------- .../templates/ingress.yaml | 2 +- .../bpdm-cleaning-service-dummy/values.yaml | 25 +++---- 6 files changed, 57 insertions(+), 56 deletions(-) diff --git a/charts/bpdm/charts/bpdm-cleaning-service-dummy/Chart.yaml b/charts/bpdm/charts/bpdm-cleaning-service-dummy/Chart.yaml index e1565830d..cb9068351 100644 --- a/charts/bpdm/charts/bpdm-cleaning-service-dummy/Chart.yaml +++ b/charts/bpdm/charts/bpdm-cleaning-service-dummy/Chart.yaml @@ -27,7 +27,6 @@ description: A Helm chart for deploying the BPDM bridge dummy service home: https://eclipse-tractusx.github.io/docs/kits/Business%20Partner%20Kit/Adoption%20View sources: - https://github.com/eclipse-tractusx/bpdm - maintainers: - name: Nico Koprowski - name: Fabio D. Mota diff --git a/charts/bpdm/charts/bpdm-cleaning-service-dummy/templates/_helpers.tpl b/charts/bpdm/charts/bpdm-cleaning-service-dummy/templates/_helpers.tpl index 34a5b3a62..a18c4dc67 100644 --- a/charts/bpdm/charts/bpdm-cleaning-service-dummy/templates/_helpers.tpl +++ b/charts/bpdm/charts/bpdm-cleaning-service-dummy/templates/_helpers.tpl @@ -61,7 +61,7 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} -{{- define "bpdm-cleaning-service-dummy.poolServiceName" -}} +{{- define "bpdm-bridge.poolServiceName" -}} {{- $config := .Values.applicationConfig -}} {{- if and $config (not (empty $config.bpdm)) -}} {{- $bpdm := $config.bpdm -}} @@ -80,7 +80,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end -}} {{- end }} -{{- define "bpdm-cleaning-service-dummy.gateServiceName" -}} +{{- define "bpdm-bridge.gateServiceName" -}} {{- $config := .Values.applicationConfig -}} {{- if and $config (not (empty $config.bpdm)) -}} {{- $bpdm := $config.bpdm -}} diff --git a/charts/bpdm/charts/bpdm-cleaning-service-dummy/templates/configMap.yaml b/charts/bpdm/charts/bpdm-cleaning-service-dummy/templates/configMap.yaml index 64753c422..b15a7f3c7 100644 --- a/charts/bpdm/charts/bpdm-cleaning-service-dummy/templates/configMap.yaml +++ b/charts/bpdm/charts/bpdm-cleaning-service-dummy/templates/configMap.yaml @@ -28,6 +28,13 @@ data: deployment.yml: |- # Place for putting standard deployment configuration # which can be overwritten by external.yml + # bpdm: + # datasource: + # host: {{ include "bpdm.postgresDependency" . }} + # pool: + # base-url: {{include "bpdm-bridge.poolServiceName" .}} + # gate: + # base-url: {{include "bpdm-bridge.gateServiceName" .}} external.yml: |- # External properties for overwriting application config {{- if .Values.applicationConfig }} diff --git a/charts/bpdm/charts/bpdm-cleaning-service-dummy/templates/deployment.yaml b/charts/bpdm/charts/bpdm-cleaning-service-dummy/templates/deployment.yaml index c2ae7ba79..2c8d26dd0 100644 --- a/charts/bpdm/charts/bpdm-cleaning-service-dummy/templates/deployment.yaml +++ b/charts/bpdm/charts/bpdm-cleaning-service-dummy/templates/deployment.yaml @@ -58,40 +58,40 @@ spec: value: {{.Values.springProfiles | join "," }} - name: SPRING_CONFIG_IMPORT value: "/etc/conf/deployment.yml,/etc/conf/external.yml,/etc/conf/secrets.yml" - ports: - - name: http - containerPort: 8084 - protocol: TCP - # @url: https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-best-practices-setting-up-health-checks-with-readiness-and-liveness-probes - livenessProbe: - {{- toYaml .Values.livenessProbe | nindent 12}} - readinessProbe: - {{- toYaml .Values.readinessProbe | nindent 12}} - startupProbe: - {{- toYaml .Values.startupProbe | nindent 12}} - resources: - {{- toYaml .Values.resources | nindent 12}} - volumeMounts: - - mountPath: /etc/conf - name: config - readOnly: true - {{- with .Values.nodeSelector}} - nodeSelector: - {{- toYaml . | nindent 8}} - {{- end}} - {{- with .Values.affinity}} - affinity: - {{- toYaml . | nindent 8}} - {{- end}} - {{- with .Values.tolerations}} - tolerations: - {{- toYaml . | nindent 8}} - {{- end}} - volumes: - - name: config - projected: - sources: - - configMap: - name: {{include "bpdm.fullname" .}} - - secret: - name: {{include "bpdm.fullname" .}} \ No newline at end of file + ports: + - name: http + containerPort: 8084 + protocol: TCP + # @url: https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-best-practices-setting-up-health-checks-with-readiness-and-liveness-probes + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12}} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12}} + startupProbe: + {{- toYaml .Values.startupProbe | nindent 12}} + resources: + {{- toYaml .Values.resources | nindent 12}} + volumeMounts: + - mountPath: /etc/conf + name: config + readOnly: true + {{- with .Values.nodeSelector}} + nodeSelector: + {{- toYaml . | nindent 8}} + {{- end}} + {{- with .Values.affinity}} + affinity: + {{- toYaml . | nindent 8}} + {{- end}} + {{- with .Values.tolerations}} + tolerations: + {{- toYaml . | nindent 8}} + {{- end}} + volumes: + - name: config + projected: + sources: + - configMap: + name: {{include "bpdm.fullname" .}} + - secret: + name: {{include "bpdm.fullname" .}} \ No newline at end of file diff --git a/charts/bpdm/charts/bpdm-cleaning-service-dummy/templates/ingress.yaml b/charts/bpdm/charts/bpdm-cleaning-service-dummy/templates/ingress.yaml index 1f0011f82..c01d31000 100644 --- a/charts/bpdm/charts/bpdm-cleaning-service-dummy/templates/ingress.yaml +++ b/charts/bpdm/charts/bpdm-cleaning-service-dummy/templates/ingress.yaml @@ -33,7 +33,7 @@ apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1beta1 {{- else -}} apiVersion: extensions/v1beta1 - {{- end }} + {{- end}} kind: Ingress metadata: name: {{$fullName}} diff --git a/charts/bpdm/charts/bpdm-cleaning-service-dummy/values.yaml b/charts/bpdm/charts/bpdm-cleaning-service-dummy/values.yaml index ee6cc9a96..46f9adba5 100644 --- a/charts/bpdm/charts/bpdm-cleaning-service-dummy/values.yaml +++ b/charts/bpdm/charts/bpdm-cleaning-service-dummy/values.yaml @@ -89,29 +89,28 @@ livenessProbe: port: 8084 scheme: HTTP failureThreshold: 3 - initialDelaySeconds: 10 - periodSeconds: 10 + initialDelaySeconds: 5 + periodSeconds: 5 successThreshold: 1 - timeoutSeconds: 10 + timeoutSeconds: 1 readinessProbe: httpGet: path: "/actuator/health/readiness" port: 8084 scheme: HTTP failureThreshold: 3 + initialDelaySeconds: 5 + periodSeconds: 5 successThreshold: 1 - initialDelaySeconds: 30 - periodSeconds: 20 - timeoutSeconds: 10 + timeoutSeconds: 1 startupProbe: httpGet: path: "/actuator/health/readiness" port: 8084 scheme: HTTP - initialDelaySeconds: 300 - periodSeconds: 20 - timeoutSeconds: 10 - + initialDelaySeconds: 60 + failureThreshold: 20 + periodSeconds: 15 # Used to overwrite the default property values of the application configuration @@ -128,8 +127,4 @@ applicationSecrets: # saas: # api-key: ... -#postgres: -# enabled: true -# auth: -# database: bpdm -# username: bpdm +