From b88b4edb0a5d43d2ac62fa49fd4da4903fc2ef45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Mac=C3=ADk?= Date: Fri, 18 Oct 2024 12:55:53 +0200 Subject: [PATCH] feat(RHIDP-4537): Ensure framework and MVP scenario works with RHDH v1.4 (#109) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel MacĂ­k --- ci-scripts/rhdh-setup/deploy.sh | 4 +- .../backstage/helm/extravolume-patch-1.4.yaml | 61 +++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 ci-scripts/rhdh-setup/template/backstage/helm/extravolume-patch-1.4.yaml diff --git a/ci-scripts/rhdh-setup/deploy.sh b/ci-scripts/rhdh-setup/deploy.sh index 867ea5e..3e3ef29 100755 --- a/ci-scripts/rhdh-setup/deploy.sh +++ b/ci-scripts/rhdh-setup/deploy.sh @@ -273,7 +273,9 @@ install_rhdh_with_helm() { cp "$chart_values" "$TMP_DIR/chart-values.temp.yaml" if [ "${AUTH_PROVIDER}" == "keycloak" ]; then yq -i '.upstream.backstage |= . + load("template/backstage/helm/oauth2-container-patch.yaml")' "$TMP_DIR/chart-values.temp.yaml"; fi if ${ENABLE_RBAC}; then - if helm search repo --devel -r rhdh --version 1.3-1 --fail-on-no-result; then + if helm search repo --devel -r rhdh --version 1.4-1 --fail-on-no-result; then + yq -i '.upstream.backstage |= . + load("template/backstage/helm/extravolume-patch-1.4.yaml")' "$TMP_DIR/chart-values.temp.yaml" + elif helm search repo --devel -r rhdh --version 1.3-1 --fail-on-no-result; then yq -i '.upstream.backstage |= . + load("template/backstage/helm/extravolume-patch-1.3.yaml")' "$TMP_DIR/chart-values.temp.yaml" elif helm search repo --devel -r rhdh --version 1.2-1 --fail-on-no-result; then yq -i '.upstream.backstage |= . + load("template/backstage/helm/extravolume-patch-1.2.yaml")' "$TMP_DIR/chart-values.temp.yaml" diff --git a/ci-scripts/rhdh-setup/template/backstage/helm/extravolume-patch-1.4.yaml b/ci-scripts/rhdh-setup/template/backstage/helm/extravolume-patch-1.4.yaml new file mode 100644 index 0000000..65ac6bf --- /dev/null +++ b/ci-scripts/rhdh-setup/template/backstage/helm/extravolume-patch-1.4.yaml @@ -0,0 +1,61 @@ +--- +extraVolumeMounts: + - name: dynamic-plugins-root + mountPath: /opt/app-root/src/dynamic-plugins-root + - name: diststatic + mountPath: /opt/app-root/src/packages/app/dist/static + - name: rbac-policy + mountPath: /opt/app-root/src/rbac +extraVolumes: + - name: dynamic-plugins-root + ephemeral: + volumeClaimTemplate: + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + # -- Size of the volume that will contain the dynamic plugins. It should be large enough to contain all the plugins. + storage: 2Gi + - name: dynamic-plugins + configMap: + defaultMode: 420 + name: '{{ printf "%s-dynamic-plugins" .Release.Name }}' + optional: true + - name: rbac-policy + configMap: + defaultMode: 420 + name: rbac-policy + - name: dynamic-plugins-npmrc + secret: + defaultMode: 420 + optional: true + secretName: dynamic-plugins-npmrc + - name: npmcacache + emptyDir: {} + - name: diststatic + emptyDir: {} +initContainers: + - name: install-dynamic-plugins + image: '{{ include "backstage.image" . }}' + command: + - ./install-dynamic-plugins.sh + - /dynamic-plugins-root + env: + - name: NPM_CONFIG_USERCONFIG + value: /opt/app-root/src/.npmrc.dynamic-plugins + imagePullPolicy: Always + volumeMounts: + - mountPath: /dynamic-plugins-root + name: dynamic-plugins-root + - mountPath: /opt/app-root/src/dynamic-plugins.yaml + name: dynamic-plugins + readOnly: true + subPath: dynamic-plugins.yaml + - mountPath: /opt/app-root/src/.npmrc.dynamic-plugins + name: dynamic-plugins-npmrc + readOnly: true + subPath: .npmrc + - mountPath: /opt/app-root/src/.npm/_cacache + name: npmcacache + workingDir: /opt/app-root/src