diff --git a/charts/backstage/Chart.yaml b/charts/backstage/Chart.yaml index 5ffdc710..92350df7 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.15.0 +version: 2.15.1 diff --git a/charts/backstage/README.md b/charts/backstage/README.md index b5e36e21..1dc5cb9f 100644 --- a/charts/backstage/README.md +++ b/charts/backstage/README.md @@ -72,6 +72,15 @@ helm repo add redhat-developer https://redhat-developer.github.io/rhdh-chart Once the chart has been added, install this chart. However before doing so, please review the default `values.yaml` and adjust as needed. +- To get proper connection between frontend and backend of Backstage please update the `apps.example.com` to match your cluster host: + + ```yaml + global: + clusterRouterBase: apps.example.com + ``` + + > Tip: you can use `helm upgrade -i --set global.clusterRouterBase=apps.example.com ...` instead of a value file + - If your cluster doesn't provide PVCs, you should disable PostgreSQL persistence via: ```yaml @@ -128,11 +137,11 @@ Kubernetes: `>= 1.25.0-0` | global.auth.backend.enabled | Enable backend service to service authentication, unless configured otherwise it generates a secret value | bool | `true` | | global.auth.backend.existingSecret | Instead of generating a secret value, refer to existing secret | string | `""` | | global.auth.backend.value | Instead of generating a secret value, use the following value | string | `""` | -| global.clusterRouterBase | Shorthand for users who do not want to specify a custom HOSTNAME. Used ONLY with the DEFAULT upstream.backstage.appConfig value and with OCP Route enabled. | string | `""` | +| global.clusterRouterBase | Shorthand for users who do not want to specify a custom HOSTNAME. Used ONLY with the DEFAULT upstream.backstage.appConfig value and with OCP Route enabled. | string | `"apps.example.com"` | | global.dynamic.includes | Array of YAML files listing dynamic plugins to include with those listed in the `plugins` field. Relative paths are resolved from the working directory of the initContainer that will install the plugins (`/opt/app-root/src`). | list | `["dynamic-plugins.default.yaml"]` | | 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`. If neither `global.clusterRouterBase` nor `global.host` are set, the helm chart will attempt to autofill with the hostname of the [OCP Ingress configuration](https://access.redhat.com/documentation/en-us/openshift_container_platform/4.14/html/networking/configuring-ingress#nw-installation-ingress-config-asset_configuring-ingress) | string | `""` | +| global.host | Custom hostname shorthand, overrides `global.clusterRouterBase`, `upstream.ingress.host`, `route.host`, and url values in `upstream.backstage.appConfig`. | 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` | @@ -193,8 +202,6 @@ OpenShift routes are enabled by default. In order to use the chart without it, p Routes can be further configured via the `route` field. -By default, the chart expects you to expose Backstage via the autogenerated hostname, which is automatically obtained from the OpenShift Ingress Configurations. - To manually provide the Backstage pod with the right context, please add the following value: ```yaml @@ -239,7 +246,7 @@ In order to deploy this chart on vanilla Kubernetes or any other non-OCP platfor ```yaml # values.yaml global: - host: # Specify your own Ingress host as automatic hostname discovery is not supported outside of OpenShift + host: # Specify your own Ingress host route: enabled: false # OpenShift Routes do not exist on vanilla Kubernetes upstream: diff --git a/charts/backstage/README.md.gotmpl b/charts/backstage/README.md.gotmpl index 48e4a73f..803c6783 100644 --- a/charts/backstage/README.md.gotmpl +++ b/charts/backstage/README.md.gotmpl @@ -66,6 +66,15 @@ helm repo add redhat-developer https://redhat-developer.github.io/rhdh-chart Once the chart has been added, install this chart. However before doing so, please review the default `values.yaml` and adjust as needed. +- To get proper connection between frontend and backend of Backstage please update the `apps.example.com` to match your cluster host: + + ```yaml + global: + clusterRouterBase: apps.example.com + ``` + + > Tip: you can use `helm upgrade -i --set global.clusterRouterBase=apps.example.com ...` instead of a value file + - If your cluster doesn't provide PVCs, you should disable PostgreSQL persistence via: ```yaml @@ -149,8 +158,6 @@ OpenShift routes are enabled by default. In order to use the chart without it, p Routes can be further configured via the `route` field. -By default, the chart expects you to expose Backstage via the autogenerated hostname, which is automatically obtained from the OpenShift Ingress Configurations. - To manually provide the Backstage pod with the right context, please add the following value: ```yaml @@ -195,7 +202,7 @@ In order to deploy this chart on vanilla Kubernetes or any other non-OCP platfor ```yaml # values.yaml global: - host: # Specify your own Ingress host as automatic hostname discovery is not supported outside of OpenShift + host: # Specify your own Ingress host route: enabled: false # OpenShift Routes do not exist on vanilla Kubernetes upstream: diff --git a/charts/backstage/templates/_helpers.tpl b/charts/backstage/templates/_helpers.tpl index cfaf08e4..53101c0f 100644 --- a/charts/backstage/templates/_helpers.tpl +++ b/charts/backstage/templates/_helpers.tpl @@ -6,18 +6,8 @@ Returns custom hostname {{- .Values.global.host -}} {{- else if .Values.global.clusterRouterBase -}} {{- printf "%s-%s.%s" (include "common.names.fullname" .) .Release.Namespace .Values.global.clusterRouterBase -}} - {{/* - Attempt to obtain a fallback value for the hostname from the openshift cluster if both global.host and global.clusterRouterBase are "" and if deployed on Openshift - */}} - {{- else if .Capabilities.APIVersions.Has "config.openshift.io/v1/Ingress" }} - {{- $cluster := (lookup "config.openshift.io/v1" "Ingress" "" "cluster") -}} - {{- if and (hasKey $cluster "spec") (hasKey $cluster.spec "domain") }} - {{- printf "%s-%s.%s" (include "common.names.fullname" .) .Release.Namespace $cluster.spec.domain -}} - {{- else -}} - {{ fail "Unable to generate hostname, OCP Ingress Resource is missing `spec.domain` field. Please provide a valid hostname in `global.host` or `global.clusterRouterBase` instead" }} - {{- end }} {{- else -}} - {{ fail "Unable to generate hostname, please provide a valid hostname in `global.host` or `global.clusterRouterBase`" }} + {{ fail "Unable to generate hostname" }} {{- end -}} {{- end -}} diff --git a/charts/backstage/values.schema.json b/charts/backstage/values.schema.json index 59c61f5f..71180401 100644 --- a/charts/backstage/values.schema.json +++ b/charts/backstage/values.schema.json @@ -33,7 +33,7 @@ "type": "object" }, "clusterRouterBase": { - "default": "", + "default": "apps.example.com", "title": "Shorthand for users who do not want to specify a custom HOSTNAME. Used ONLY with the DEFAULT upstream.backstage.appConfig value and with OCP Route enabled.", "type": "string" }, @@ -6996,4 +6996,4 @@ }, "title": "Root Schema", "type": "object" -} \ No newline at end of file +} diff --git a/charts/backstage/values.schema.tmpl.json b/charts/backstage/values.schema.tmpl.json index f0a9e864..61b8efc8 100644 --- a/charts/backstage/values.schema.tmpl.json +++ b/charts/backstage/values.schema.tmpl.json @@ -23,7 +23,7 @@ "clusterRouterBase": { "title": "Shorthand for users who do not want to specify a custom HOSTNAME. Used ONLY with the DEFAULT upstream.backstage.appConfig value and with OCP Route enabled.", "type": "string", - "default": "" + "default": "apps.example.com" }, "host": { "title": "Custom hostname shorthand, overrides `global.clusterRouterBase`, `upstream.ingress.host`, `route.host`, and url values in `upstream.backstage.appConfig`", diff --git a/charts/backstage/values.yaml b/charts/backstage/values.yaml index b83e6a14..7d8c64c2 100644 --- a/charts/backstage/values.yaml +++ b/charts/backstage/values.yaml @@ -14,9 +14,8 @@ global: plugins: [] # -- Shorthand for users who do not want to specify a custom HOSTNAME. Used ONLY with the DEFAULT upstream.backstage.appConfig value and with OCP Route enabled. - clusterRouterBase: "" + clusterRouterBase: "apps.example.com" # -- Custom hostname shorthand, overrides `global.clusterRouterBase`, `upstream.ingress.host`, `route.host`, and url values in `upstream.backstage.appConfig`. - # If neither `global.clusterRouterBase` nor `global.host` are set, the helm chart will attempt to autofill with the hostname of the [OCP Ingress configuration](https://access.redhat.com/documentation/en-us/openshift_container_platform/4.14/html/networking/configuring-ingress#nw-installation-ingress-config-asset_configuring-ingress) host: "" # -- Enable service authentication within Backstage instance auth: