Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Commit

Permalink
feat: further simplify the config for autogenerated Route host in OCP
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Coufal <tcoufal@redhat.com>
  • Loading branch information
tumido committed Jun 8, 2023
1 parent c21baae commit 1d3ced7
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 24 deletions.
2 changes: 1 addition & 1 deletion charts/backstage/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 6 additions & 10 deletions charts/backstage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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` |
Expand Down
13 changes: 4 additions & 9 deletions charts/backstage/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions charts/backstage/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
10 changes: 10 additions & 0 deletions charts/backstage/values.schema.tmpl.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 8 additions & 4 deletions charts/backstage/values.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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}
Expand Down

0 comments on commit 1d3ced7

Please sign in to comment.