diff --git a/charts/backstage/Chart.yaml b/charts/backstage/Chart.yaml index 50faf2eb..1a68641f 100644 --- a/charts/backstage/Chart.yaml +++ b/charts/backstage/Chart.yaml @@ -41,4 +41,4 @@ sources: # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.10.4 +version: 2.10.5 diff --git a/charts/backstage/README.md b/charts/backstage/README.md index bfa08c62..69f380df 100644 --- a/charts/backstage/README.md +++ b/charts/backstage/README.md @@ -2,7 +2,7 @@ # Janus-IDP Backstage Helm Chart [![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/janus-idp&style=flat-square)](https://artifacthub.io/packages/search?repo=janus-idp) -![Version: 2.10.4](https://img.shields.io/badge/Version-2.10.4-informational?style=flat-square) +![Version: 2.10.5](https://img.shields.io/badge/Version-2.10.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) A Helm chart for deploying a Backstage application @@ -138,6 +138,9 @@ Kubernetes: `>= 1.19.0-0` | global.dynamic.includes[0] | List of dynamic plugins included inside the `janus-idp/backstage-showcase` container image, some of which are disabled by default. This file ONLY works with the `janus-idp/backstage-showcase` container image. | string | `"dynamic-plugins.default.yaml"` | | global.dynamic.plugins | List of dynamic plugins, possibly overriding the plugins listed in `includes` files. Every item defines the plugin `package` as a [NPM package spec](https://docs.npmjs.com/cli/v10/using-npm/package-spec), an optional `pluginConfig` with plugin-specific backstage configuration, and an optional `disabled` flag to disable/enable a plugin listed in `includes` files. It also includes an `integrity` field that is used to verify the plugin package [integrity](https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description). | list | `[]` | | global.host | Custom hostname shorthand, overrides `global.clusterRouterBase`, `upstream.ingress.host`, `route.host`, and url values in `upstream.backstage.appConfig` | string | `""` | +| global.postgresql | Global configuration values for PostgreSQL | object | `{"auth":{"existingSecret":""}}` | +| global.postgresql.auth | The authentication details of the Postgres database | object | `{"existingSecret":""}` | +| global.postgresql.auth.existingSecret | Name of existing secret to use for PostgreSQL credentials | string | `""` | | route | OpenShift Route parameters | object | `{"annotations":{},"enabled":true,"host":"{{ .Values.global.host }}","path":"/","tls":{"caCertificate":"","certificate":"","destinationCACertificate":"","enabled":true,"insecureEdgeTerminationPolicy":"Redirect","key":"","termination":"edge"},"wildcardPolicy":"None"}` | | route.annotations | Route specific annotations | object | `{}` | | route.enabled | Enable the creation of the route resource | bool | `true` | diff --git a/charts/backstage/templates/_helpers.tpl b/charts/backstage/templates/_helpers.tpl index f7869893..9c24a41f 100644 --- a/charts/backstage/templates/_helpers.tpl +++ b/charts/backstage/templates/_helpers.tpl @@ -21,3 +21,29 @@ Returns a secret name for service to service auth {{- include "common.names.fullname" . -}}-auth {{- end -}} {{- end -}} + +{{/* +Sets the secretKeyRef name for Backstage to the PostgreSQL existing secret if it present +*/}} +{{- define "janus-idp.backstage.existingSecret" -}} + {{- if .Values.postgresql.auth.existingSecret -}} + {{- .Values.postgresql.auth.existingSecret -}} + {{- else if .Values.global.postgresql.auth.existingSecret -}} + {{- .Values.global.postgresql.auth.existingSecret -}} + {{- else -}} + {{- printf "%s-%s" .Release.Name "postgresql" -}} + {{- end -}} +{{- end -}} + +{{/* +Sets the secretKeyRef name for PostgreSQL to the PostgreSQL existing secret if it present +*/}} +{{- define "janus-idp.postgresql.existingSecret" -}} + {{- if .Values.auth.existingSecret -}} + {{- .Values.auth.existingSecret -}} + {{- else if .Values.global.postgresql.auth.existingSecret -}} + {{- .Values.global.postgresql.auth.existingSecret -}} + {{- else -}} + {{- printf "%s-%s" .Release.Name "postgresql" -}} + {{- end -}} +{{- end -}} diff --git a/charts/backstage/values.yaml b/charts/backstage/values.yaml index 457e58d1..55431311 100644 --- a/charts/backstage/values.yaml +++ b/charts/backstage/values.yaml @@ -28,6 +28,12 @@ global: existingSecret: "" # -- Instead of generating a secret value, use fo;lowing value value: "" + # -- Global configuration values for PostgreSQL + postgresql: + # -- The authentication details of the Postgres database + auth: + # -- Name of existing secret to use for PostgreSQL credentials + existingSecret: '' # -- Upstream Backstage [chart configuration](https://github.com/backstage/charts/blob/main/charts/backstage/values.yaml) # @default -- Use Openshift compatible settings @@ -91,7 +97,7 @@ upstream: valueFrom: secretKeyRef: key: postgres-password - name: "{{ .Release.Name }}-postgresql" + name: '{{- include "janus-idp.backstage.existingSecret" . }}' args: # This additional `app-config`` file is generated by the initContainer below, and contains the merged configuration of installed dynamic plugins. @@ -185,7 +191,7 @@ upstream: valueFrom: secretKeyRef: key: postgres-password - name: "{{ .Release.Name }}-postgresql" + name: '{{- include "janus-idp.postgresql.existingSecret" . }}' ingress: host: "{{ .Values.global.host }}"