From 1d3ced728cb00a4b72ac1807481b71c964f7d4a5 Mon Sep 17 00:00:00 2001 From: Tomas Coufal Date: Fri, 2 Jun 2023 12:03:18 +0200 Subject: [PATCH] feat: further simplify the config for autogenerated Route host in OCP Signed-off-by: Tomas Coufal --- charts/backstage/Chart.yaml | 2 +- charts/backstage/README.md | 16 ++++++---------- charts/backstage/README.md.gotmpl | 13 ++++--------- charts/backstage/values.schema.json | 10 ++++++++++ charts/backstage/values.schema.tmpl.json | 10 ++++++++++ charts/backstage/values.yaml | 12 ++++++++---- 6 files changed, 39 insertions(+), 24 deletions(-) diff --git a/charts/backstage/Chart.yaml b/charts/backstage/Chart.yaml index 27199e8b..b3f144c2 100644 --- a/charts/backstage/Chart.yaml +++ b/charts/backstage/Chart.yaml @@ -42,4 +42,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.0.2 +version: 2.1.0 diff --git a/charts/backstage/README.md b/charts/backstage/README.md index c36c22d6..792b5026 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.0.2](https://img.shields.io/badge/Version-2.0.2-informational?style=flat-square) +![Version: 2.1.0](https://img.shields.io/badge/Version-2.1.0-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 @@ -73,17 +73,12 @@ Once the chart has been added, install this chart. However before doing so, plea - To get proper connection between frontend and backend of Backstage please update the `apps.example.com` to match your cluster host: ```yaml - upstream: - backstage: - appConfig: - app: - baseUrl: 'https://{{- print .Release.Name "-" .Release.Namespace -}}.apps.example.com' - backend: - baseUrl: 'https://{{- print .Release.Name "-" .Release.Namespace -}}.apps.example.com' - cors: - origin: 'https://{{- print .Release.Name "-" .Release.Namespace -}}.apps.example.com' + 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 @@ -133,6 +128,7 @@ Kubernetes: `>= 1.19.0-0` | Key | Description | Type | Default | |-----|-------------|------|---------| +| global.clusterRouterBase | Arbitrary value used only with default upstream.backstage.appConfig value and with OCP autogenerated Route host. | string | `"apps.example.com"` | | route | OpenShift Route parameters | object | `{"annotations":{},"enabled":true,"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/README.md.gotmpl b/charts/backstage/README.md.gotmpl index 5fd9829c..432e2cbc 100644 --- a/charts/backstage/README.md.gotmpl +++ b/charts/backstage/README.md.gotmpl @@ -67,17 +67,12 @@ Once the chart has been added, install this chart. However before doing so, plea - To get proper connection between frontend and backend of Backstage please update the `apps.example.com` to match your cluster host: ```yaml - upstream: - backstage: - appConfig: - app: - baseUrl: 'https://{{"{{"}}- print .Release.Name "-" .Release.Namespace -{{"}}"}}.apps.example.com' - backend: - baseUrl: 'https://{{"{{"}}- print .Release.Name "-" .Release.Namespace -{{"}}"}}.apps.example.com' - cors: - origin: 'https://{{"{{"}}- print .Release.Name "-" .Release.Namespace -{{"}}"}}.apps.example.com' + 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 diff --git a/charts/backstage/values.schema.json b/charts/backstage/values.schema.json index d9944123..18724a1c 100644 --- a/charts/backstage/values.schema.json +++ b/charts/backstage/values.schema.json @@ -2,6 +2,16 @@ "$id": "https://raw.githubusercontent.com/janus-idp/helm-backstage/main/charts/backstage/values.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { + "global": { + "properties": { + "clusterRouterBase": { + "default": "apps.example.com", + "title": "Arbitrary value used only with default upstream.backstage.appConfig value and with OCP autogenerated Route host.", + "type": "string" + } + }, + "type": "object" + }, "route": { "additionalProperties": false, "properties": { diff --git a/charts/backstage/values.schema.tmpl.json b/charts/backstage/values.schema.tmpl.json index 38afa88f..c9b062c5 100644 --- a/charts/backstage/values.schema.tmpl.json +++ b/charts/backstage/values.schema.tmpl.json @@ -17,6 +17,16 @@ } } }, + "global": { + "type": "object", + "properties": { + "clusterRouterBase": { + "title": "Arbitrary value used only with default upstream.backstage.appConfig value and with OCP autogenerated Route host.", + "type": "string", + "default": "apps.example.com" + } + } + }, "route": { "title": "OpenShift Route parameters.", "type": "object", diff --git a/charts/backstage/values.yaml b/charts/backstage/values.yaml index e4c7ec84..9ab0153f 100644 --- a/charts/backstage/values.yaml +++ b/charts/backstage/values.yaml @@ -1,3 +1,7 @@ +global: + # -- Arbitrary value used only with default upstream.backstage.appConfig value and with OCP autogenerated Route host. + clusterRouterBase: apps.example.com + # -- Upstream Backstage [chart configuration](https://github.com/backstage/charts/blob/main/charts/backstage/values.yaml) # @default -- Use Openshift compatible settings upstream: @@ -17,12 +21,12 @@ upstream: # can't accommodate that properly. appConfig: app: - # Please update to match host. - baseUrl: 'https://{{- print .Release.Name "-" .Release.Namespace -}}.apps.example.com' + # Please update to match host in case you don't want to use the OCP autogenerated Route host. + baseUrl: 'https://{{- print .Release.Name "-" .Release.Namespace "." .Values.global.clusterRouterBase }}' backend: - baseUrl: 'https://{{- print .Release.Name "-" .Release.Namespace -}}.apps.example.com' + baseUrl: 'https://{{- print .Release.Name "-" .Release.Namespace "." .Values.global.clusterRouterBase }}' cors: - origin: 'https://{{- print .Release.Name "-" .Release.Namespace -}}.apps.example.com' + origin: 'https://{{- print .Release.Name "-" .Release.Namespace "." .Values.global.clusterRouterBase }}' database: connection: password: ${POSTGRESQL_ADMIN_PASSWORD}