From 8a4dd35e3ce7433a2aa843e835397f02375c52e1 Mon Sep 17 00:00:00 2001 From: adkumar1 Date: Tue, 5 Sep 2023 18:13:14 +0530 Subject: [PATCH 1/4] updated deployment with secret --- charts/orchestrator/templates/secret.yaml | 97 +++++++++++++++++++++++ charts/orchestrator/values.yaml | 9 ++- 2 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 charts/orchestrator/templates/secret.yaml diff --git a/charts/orchestrator/templates/secret.yaml b/charts/orchestrator/templates/secret.yaml new file mode 100644 index 00000000..10ee34e0 --- /dev/null +++ b/charts/orchestrator/templates/secret.yaml @@ -0,0 +1,97 @@ +#****************************************************************************** +# Copyright (c) 2022, 2023 T-Systems International GmbH +# Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 +#******************************************************************************* + +apiVersion: v1 +kind: Secret +type: Opaque +metadata: + name: {{ .Values.secretRef }} +stringData: + connectorTestServiceUrl: default + connectorregisterUrl: default + connectorregisterkeycloakclientId: default + connectorregisterkeycloakclientSecret: default + connectorregisterkeycloaktokenURI: default + dapsJksUrl: default + dapsTokenUrl: default + dapsUrl: default + dbUrl: jdbc:postgresql://postgresql:5432/postgres + dbpassword: default + dbuser: postgres + dnsname: default + dnsnameProtocol: default + edc_miwUrl: default + edc_ssi_authorityId: default + emailpassword: default + emailuser: default + keycloakAuthserverUrl: default + keycloakBearerOnly: "true" + keycloakClientid: default + keycloakRealm: default + keycloakResource: default + keycloakSslRequired: external + keycloakUseResourceRoleMappings: "true" + kubeappsToken: default + kubeappsUrl: default + mail_from: default + mail_to: default + manual-connector-registration: "false" + manualupdate: "true" + password: default + portalclientid: default + portalclientsecret: default + portalemail: default + portaltokenurl: default + portalurl: default + postgres-password: default + resourceServerIssuer: default + sde_bpndiscovery-hostname: default + sde_connector-discovery-clientId: default + sde_connector-discovery-clientSecret: default + sde_connector-discovery-token-url: default + sde_digital-twins-authentication-url: default + sde_digital-twins-hostname: default + sde_discovery-authentication-url: default + sde_discovery-clientId: default + sde_discovery-clientSecret: default + sde_discovery-grantType: default + sde_dtregistry-url-prefix: default + sde_dtregistryidp-client-id: default + sde_dtregistrytenant-id: default + sde_keycloak-auth: default + sde_keycloak-realm: default + sde_keycloak-tokenUrl: default + sde_partner-pool-clientId: default + sde_partner-pool-clientSecret: default + sde_partner-pool-hostname: default + sde_portal-backend-authentication-url: default + sde_portal-backend-clientId: default + sde_portal-backend-clientSecret: default + sde_portal-backend-hostname: default + sde_resource-server-issuer: default + smtp_auth: "true" + smtp_host: default + smtp_port: default + smtp_tls_enable: "true" + targetCluster: default + targetNamesapce: default + vaultToken: default + vaultUrl: default + \ No newline at end of file diff --git a/charts/orchestrator/values.yaml b/charts/orchestrator/values.yaml index 1aa6135f..45c27d49 100644 --- a/charts/orchestrator/values.yaml +++ b/charts/orchestrator/values.yaml @@ -113,18 +113,19 @@ readinessProbe: successThreshold: 1 timeoutSeconds: 1 -secretRef: "" +secretRef: "managed-service-orchestrator" postgresql: # -- Enable the dependency postgres database enabled: true + fullnameOverride: postgresql metrics: containerSecurityContext: enabled: false auth: username: "" database: "" - existingSecret: "" + existingSecret: "managed-service-orchestrator" secretKeys: - adminPasswordKey: "" - userPasswordKey: "" + adminPasswordKey: "dbpassword" + userPasswordKey: "dbpassword" From da3ef66f10f18b86045b146467c47081e62971ac Mon Sep 17 00:00:00 2001 From: adkumar1 Date: Wed, 6 Sep 2023 10:44:39 +0530 Subject: [PATCH 2/4] updated db --- charts/orchestrator/templates/deployment.yaml | 6 ++++++ charts/orchestrator/templates/secret.yaml | 6 +++--- charts/orchestrator/values.yaml | 20 ++++++++----------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/charts/orchestrator/templates/deployment.yaml b/charts/orchestrator/templates/deployment.yaml index 3a2eabfa..442dda6f 100644 --- a/charts/orchestrator/templates/deployment.yaml +++ b/charts/orchestrator/templates/deployment.yaml @@ -67,6 +67,12 @@ spec: value: "3" - name: RETRY_BACKOFFDELAY value: "500" + - name: SPRING_DATASOURCE_URL + value: "jdbc:postgresql://{{ .Values.postgresql.fullnameOverride }}:{{ .Values.postgresql.auth.port }}/{{ .Values.postgresql.auth.database }}" + - name: SPRING_DATASOURCE_USERNAME + value: {{ .Values.postgresql.auth.username | required ".Values.postgresql.auth.username is required" | quote }} + - name: SPRING_DATASOURCE_PASSWORD + value: {{ .Values.postgresql.auth.password | required ".Values.postgresql.auth.password is required" | quote}} resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/charts/orchestrator/templates/secret.yaml b/charts/orchestrator/templates/secret.yaml index 10ee34e0..c870c3a7 100644 --- a/charts/orchestrator/templates/secret.yaml +++ b/charts/orchestrator/templates/secret.yaml @@ -32,9 +32,9 @@ stringData: dapsJksUrl: default dapsTokenUrl: default dapsUrl: default - dbUrl: jdbc:postgresql://postgresql:5432/postgres - dbpassword: default - dbuser: postgres + #dbUrl: jdbc:postgresql://postgresql:5432/postgres + #dbpassword: default + #dbuser: postgres dnsname: default dnsnameProtocol: default edc_miwUrl: default diff --git a/charts/orchestrator/values.yaml b/charts/orchestrator/values.yaml index 45c27d49..75a8020f 100644 --- a/charts/orchestrator/values.yaml +++ b/charts/orchestrator/values.yaml @@ -114,18 +114,14 @@ readinessProbe: timeoutSeconds: 1 secretRef: "managed-service-orchestrator" - + postgresql: - # -- Enable the dependency postgres database enabled: true - fullnameOverride: postgresql - metrics: - containerSecurityContext: - enabled: false + fullnameOverride: "postgresql" auth: - username: "" - database: "" - existingSecret: "managed-service-orchestrator" - secretKeys: - adminPasswordKey: "dbpassword" - userPasswordKey: "dbpassword" + postgresPassword: "default" + username: "default" + password: "default" + database: "default" + port: 5432 + existingSecret: "" From 9a30b785023f02621da80c256a56d521497f8428 Mon Sep 17 00:00:00 2001 From: adkumar1 Date: Wed, 6 Sep 2023 10:55:40 +0530 Subject: [PATCH 3/4] postgres db update --- charts/orchestrator/values.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/charts/orchestrator/values.yaml b/charts/orchestrator/values.yaml index 75a8020f..c3a2e0e4 100644 --- a/charts/orchestrator/values.yaml +++ b/charts/orchestrator/values.yaml @@ -114,14 +114,13 @@ readinessProbe: timeoutSeconds: 1 secretRef: "managed-service-orchestrator" - + postgresql: enabled: true fullnameOverride: "postgresql" auth: - postgresPassword: "default" - username: "default" + username: "postgres" password: "default" - database: "default" + database: "postgres" port: 5432 existingSecret: "" From e610c8c18b5c78864316cba6d92b9bdfc684b46e Mon Sep 17 00:00:00 2001 From: adkumar1 Date: Wed, 6 Sep 2023 11:27:38 +0530 Subject: [PATCH 4/4] added helm upgrade step --- .github/workflows/helm-lint.yaml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/helm-lint.yaml b/.github/workflows/helm-lint.yaml index aa35205a..f36c5ade 100644 --- a/.github/workflows/helm-lint.yaml +++ b/.github/workflows/helm-lint.yaml @@ -36,6 +36,10 @@ on: default: 'kindest/node:v1.24.6' required: false type: string + upgrade_from: + description: 'Managed service orchestrator service chart version to upgrade from' + # version from 3.1 release + default: '1.4.2' jobs: lint-test: @@ -51,6 +55,12 @@ jobs: with: version: v0.19.0 node_image: ${{ github.event.inputs.node_image || 'kindest/node:v1.24.6' }} + - name: Build image + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: kind-registry:5000/managed-service-orchestrator:testing - name: Set up Helm uses: azure/setup-helm@v3 @@ -77,9 +87,15 @@ jobs: - name: Run chart-testing (lint) run: ct lint --charts charts/orchestrator --config charts/chart-testing-config.yaml - - name: Run helm install + + - name: Run chart-testing (install) + run: ct install --charts charts/orchestrator --config charts/chart-testing-config.yaml --helm-extra-set-args "--set=image.tag=testing --set=image.repository=kind-registry:5000/managed-service-orchestrator" + if: github.event_name != 'pull_request' || steps.list-changed.outputs.changed == 'true' + + - name: Run helm upgrade run: | helm repo add bitnami https://charts.bitnami.com/bitnami helm repo add tractusx-dev https://eclipse-tractusx.github.io/charts/dev - helm install orchestrator charts/orchestrator --namespace install --create-namespace + helm install orchestrator charts/orchestrator + helm upgrade orchestrator charts/orchestrator if: github.event_name != 'pull_request' || steps.list-changed.outputs.changed == 'true'