From 8ba6bff315634b5eab538ece8fb7055e038496f6 Mon Sep 17 00:00:00 2001 From: Danijel Simeunovic Date: Thu, 23 Apr 2026 15:35:50 +0200 Subject: [PATCH 1/5] backstage --- docs/REFERENCE.md | 46 +++++++++++++ infra/base/backstage.yaml | 42 ++++++++++++ infra/base/kustomization.yaml | 1 + infra/values/base/backstage-values.yaml | 91 +++++++++++++++++++++++++ 4 files changed, 180 insertions(+) create mode 100644 infra/base/backstage.yaml create mode 100644 infra/values/base/backstage-values.yaml diff --git a/docs/REFERENCE.md b/docs/REFERENCE.md index d026c47..bbfc685 100644 --- a/docs/REFERENCE.md +++ b/docs/REFERENCE.md @@ -965,6 +965,52 @@ ignore: - Check Gitea Actions tab for workflow run status and logs - Monitor Anthropic usage dashboard for token consumption +### Backstage (Developer Portal) + +**Chart**: `backstage/backstage` +**Version**: `2.6.3` +**Namespace**: `backstage` +**Helm Repo**: `https://backstage.github.io/charts` + +**Purpose**: Internal developer portal where teams register and broadcast themselves, their applications, APIs, and systems. Provides a unified catalog, templates, and documentation hub. + +**Configuration** (`infra/values/base/backstage-values.yaml`): +- PostgreSQL subchart enabled for persistence (standalone, 2Gi) +- Traefik ingress with `websecure` entrypoint +- App title: "Forte Developer Portal" +- Catalog rules: Component, System, API, Resource, Location, Template, Group, User, Domain + +**Catalog Registration**: +Teams register services by adding a `catalog-info.yaml` to their repo root: +```yaml +apiVersion: backstage.io/v1alpha1 +kind: Component +metadata: + name: my-service + description: My service description + annotations: + backstage.io/source-location: url:https://git.forteapps.net/Forte/my-service +spec: + type: service + lifecycle: production + owner: team-name +``` + +Then add the location to `backstage-values.yaml` under `appConfig.catalog.locations`. + +**Per-cluster Configuration**: +To set the ingress hostname, create a per-cluster overlay values file (e.g., `infra/values/upc-dev/backstage-values.yaml`) with: +```yaml +backstage: + appConfig: + app: + baseUrl: https://backstage.example.com + backend: + baseUrl: https://backstage.example.com +ingress: + host: backstage.example.com +``` + ### Keycloak Client Registrar **Type**: CronJob (deployed via Keycloak Helm chart `extraDeploy`) diff --git a/infra/base/backstage.yaml b/infra/base/backstage.yaml new file mode 100644 index 0000000..8f1c501 --- /dev/null +++ b/infra/base/backstage.yaml @@ -0,0 +1,42 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: backstage + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: "1" + labels: + app.kubernetes.io/name: backstage + app.kubernetes.io/part-of: developer-portal + app.kubernetes.io/managed-by: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + + sources: + - repoURL: https://backstage.github.io/charts + chart: backstage + targetRevision: "2.6.3" + helm: + releaseName: backstage + valueFiles: + - $values/infra/values/base/backstage-values.yaml + + - repoURL: ssh://git@git.forteapps.net:2222/Forte/launchpad.git + targetRevision: HEAD + ref: values + + destination: + server: https://kubernetes.default.svc + namespace: backstage + + syncPolicy: + automated: + prune: true + selfHeal: true + allowEmpty: false + syncOptions: + - CreateNamespace=true + - Validate=true + - ServerSideApply=true diff --git a/infra/base/kustomization.yaml b/infra/base/kustomization.yaml index 5c1beb1..f6206a4 100644 --- a/infra/base/kustomization.yaml +++ b/infra/base/kustomization.yaml @@ -22,3 +22,4 @@ resources: - tempo.yaml - grafana-dashboards.yaml - network-policies-application.yaml +- backstage.yaml diff --git a/infra/values/base/backstage-values.yaml b/infra/values/base/backstage-values.yaml new file mode 100644 index 0000000..95ea346 --- /dev/null +++ b/infra/values/base/backstage-values.yaml @@ -0,0 +1,91 @@ +# Backstage - Internal Developer Portal +# Helm chart: https://github.com/backstage/charts + +backstage: + image: + registry: ghcr.io + repository: backstage/backstage + tag: latest + + resources: + requests: + cpu: 100m + memory: 256Mi + limits: + cpu: 500m + memory: 512Mi + + extraEnvVars: + - name: POSTGRES_HOST + value: "{{ .Release.Name }}-postgresql" + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_USER + value: backstage + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: "{{ .Release.Name }}-postgresql" + key: password + + appConfig: + app: + title: "Forte Developer Portal" + baseUrl: http://localhost:3000 + + backend: + baseUrl: http://localhost:7007 + listen: + port: 7007 + database: + client: pg + connection: + host: ${POSTGRES_HOST} + port: ${POSTGRES_PORT} + user: ${POSTGRES_USER} + password: ${POSTGRES_PASSWORD} + + catalog: + rules: + - allow: + - Component + - System + - API + - Resource + - Location + - Template + - Group + - User + - Domain + locations: + # Register components from Gitea repositories + # Example: uncomment and adjust to scan your Gitea org + # - type: url + # target: https://git.forteapps.net/Forte/*/blob/main/catalog-info.yaml + # rules: + # - allow: [Component, System, API] + +ingress: + enabled: true + className: traefik + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: websecure + +postgresql: + enabled: true + auth: + username: backstage + password: "" + existingSecret: "" + architecture: standalone + primary: + resources: + requests: + cpu: 50m + memory: 128Mi + limits: + cpu: 250m + memory: 256Mi + persistence: + enabled: true + size: 2Gi -- 2.49.1 From dc7074312b413113e4289457e0ac47616f4b8444 Mon Sep 17 00:00:00 2001 From: Danijel Simeunovic Date: Thu, 23 Apr 2026 15:46:34 +0200 Subject: [PATCH 2/5] RHDH backstage --- docs/REFERENCE.md | 45 ++++-- infra/base/backstage.yaml | 4 +- infra/values/base/backstage-values.yaml | 176 ++++++++++++------------ 3 files changed, 125 insertions(+), 100 deletions(-) diff --git a/docs/REFERENCE.md b/docs/REFERENCE.md index bbfc685..e722606 100644 --- a/docs/REFERENCE.md +++ b/docs/REFERENCE.md @@ -965,21 +965,37 @@ ignore: - Check Gitea Actions tab for workflow run status and logs - Monitor Anthropic usage dashboard for token consumption -### Backstage (Developer Portal) +### Backstage / RHDH (Developer Portal) -**Chart**: `backstage/backstage` -**Version**: `2.6.3` +**Chart**: `backstage` (RHDH — Red Hat Developer Hub) +**Version**: `5.8.0` **Namespace**: `backstage` -**Helm Repo**: `https://backstage.github.io/charts` +**Helm Repo**: `https://redhat-developer.github.io/rhdh-chart` +**Image**: `quay.io/rhdh-community/rhdh:next` **Purpose**: Internal developer portal where teams register and broadcast themselves, their applications, APIs, and systems. Provides a unified catalog, templates, and documentation hub. +**Why RHDH over vanilla Backstage**: Ships 27+ plugins pre-bundled (ArgoCD, Kubernetes, Keycloak, GitHub, GitLab, Jira, SonarQube, Tekton, Jenkins, Quay, and more). Supports dynamic plugin installation at runtime — no image rebuilds needed. + **Configuration** (`infra/values/base/backstage-values.yaml`): -- PostgreSQL subchart enabled for persistence (standalone, 2Gi) +- OpenShift Route disabled (`route.enabled: false`) — uses Traefik ingress instead +- PostgreSQL subchart enabled for persistence (2Gi) +- SecurityContext configured for vanilla Kubernetes (non-OpenShift) - Traefik ingress with `websecure` entrypoint - App title: "Forte Developer Portal" +- Dynamic plugins: loads `dynamic-plugins.default.yaml` (all 27+ bundled plugins) - Catalog rules: Component, System, API, Resource, Location, Template, Group, User, Domain +**Dynamic Plugins**: +Add plugins at runtime via `global.dynamic.plugins` in values — no image rebuild: +```yaml +global: + dynamic: + plugins: + - package: "@scope/my-plugin@1.0.0" + integrity: "sha512-..." +``` + **Catalog Registration**: Teams register services by adding a `catalog-info.yaml` to their repo root: ```yaml @@ -996,19 +1012,22 @@ spec: owner: team-name ``` -Then add the location to `backstage-values.yaml` under `appConfig.catalog.locations`. +Then add the location to `backstage-values.yaml` under `upstream.backstage.appConfig.catalog.locations`. **Per-cluster Configuration**: To set the ingress hostname, create a per-cluster overlay values file (e.g., `infra/values/upc-dev/backstage-values.yaml`) with: ```yaml -backstage: - appConfig: - app: - baseUrl: https://backstage.example.com - backend: - baseUrl: https://backstage.example.com -ingress: +global: host: backstage.example.com +upstream: + backstage: + appConfig: + app: + baseUrl: https://backstage.example.com + backend: + baseUrl: https://backstage.example.com + ingress: + host: backstage.example.com ``` ### Keycloak Client Registrar diff --git a/infra/base/backstage.yaml b/infra/base/backstage.yaml index 8f1c501..52de3f7 100644 --- a/infra/base/backstage.yaml +++ b/infra/base/backstage.yaml @@ -15,9 +15,9 @@ spec: project: default sources: - - repoURL: https://backstage.github.io/charts + - repoURL: https://redhat-developer.github.io/rhdh-chart chart: backstage - targetRevision: "2.6.3" + targetRevision: "5.8.0" helm: releaseName: backstage valueFiles: diff --git a/infra/values/base/backstage-values.yaml b/infra/values/base/backstage-values.yaml index 95ea346..9edcb51 100644 --- a/infra/values/base/backstage-values.yaml +++ b/infra/values/base/backstage-values.yaml @@ -1,91 +1,97 @@ -# Backstage - Internal Developer Portal -# Helm chart: https://github.com/backstage/charts +# Red Hat Developer Hub (RHDH) - Internal Developer Portal +# Helm chart: https://github.com/redhat-developer/rhdh-chart +# Includes 27+ plugins out of the box: ArgoCD, Kubernetes, Keycloak, +# GitHub, GitLab, Jira, SonarQube, Tekton, Jenkins, and more. -backstage: - image: - registry: ghcr.io - repository: backstage/backstage - tag: latest - - resources: - requests: - cpu: 100m - memory: 256Mi - limits: - cpu: 500m - memory: 512Mi - - extraEnvVars: - - name: POSTGRES_HOST - value: "{{ .Release.Name }}-postgresql" - - name: POSTGRES_PORT - value: "5432" - - name: POSTGRES_USER - value: backstage - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: "{{ .Release.Name }}-postgresql" - key: password - - appConfig: - app: - title: "Forte Developer Portal" - baseUrl: http://localhost:3000 - - backend: - baseUrl: http://localhost:7007 - listen: - port: 7007 - database: - client: pg - connection: - host: ${POSTGRES_HOST} - port: ${POSTGRES_PORT} - user: ${POSTGRES_USER} - password: ${POSTGRES_PASSWORD} - - catalog: - rules: - - allow: - - Component - - System - - API - - Resource - - Location - - Template - - Group - - User - - Domain - locations: - # Register components from Gitea repositories - # Example: uncomment and adjust to scan your Gitea org - # - type: url - # target: https://git.forteapps.net/Forte/*/blob/main/catalog-info.yaml - # rules: - # - allow: [Component, System, API] - -ingress: - enabled: true - className: traefik - annotations: - traefik.ingress.kubernetes.io/router.entrypoints: websecure - -postgresql: - enabled: true +global: auth: - username: backstage - password: "" - existingSecret: "" - architecture: standalone - primary: + backend: + enabled: true + dynamic: + includes: + - dynamic-plugins.default.yaml + plugins: [] + +# Disable OpenShift Route (not on OpenShift) +route: + enabled: false + +upstream: + backstage: + image: + registry: quay.io + repository: rhdh-community/rhdh + tag: next + + podSecurityContext: + runAsUser: 1001 + runAsGroup: 1001 + fsGroup: 1001 + resources: requests: - cpu: 50m - memory: 128Mi - limits: cpu: 250m - memory: 256Mi - persistence: + memory: 1Gi + limits: + cpu: 1000m + memory: 2560Mi + + appConfig: + app: + title: "Forte Developer Portal" + baseUrl: http://localhost:7007 + + backend: + baseUrl: http://localhost:7007 + database: + client: better-sqlite3 + connection: ":memory:" + + catalog: + rules: + - allow: + - Component + - System + - API + - Resource + - Location + - Template + - Group + - User + - Domain + locations: [] + # Register components from Gitea repositories by adding: + # - type: url + # target: https://git.forteapps.net/Forte/my-repo/raw/branch/main/catalog-info.yaml + # rules: + # - allow: [Component, System, API] + + ingress: + enabled: true + className: traefik + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: websecure + + postgresql: + enabled: true + image: + registry: docker.io + repository: library/postgres + tag: "15" + primary: + persistence: + enabled: true + size: 2Gi + podSecurityContext: + enabled: true + fsGroup: 26 + runAsUser: 26 + resources: + requests: + cpu: 50m + memory: 128Mi + limits: + cpu: 250m + memory: 512Mi + volumePermissions: enabled: true - size: 2Gi -- 2.49.1 From 34ff37edbfd20f6ab27e913c3a65eb2cd4ca517f Mon Sep 17 00:00:00 2001 From: Danijel Simeunovic Date: Thu, 23 Apr 2026 20:31:04 +0200 Subject: [PATCH 3/5] config --- .../backstage-keycloak-client-config.yaml | 43 +++++++++++++++++ docs/REFERENCE.md | 44 ++++++++++------- infra/base/backstage.yaml | 1 + infra/values/base/backstage-values.yaml | 48 ++++++++++++++++--- infra/values/upc-dev/backstage-values.yaml | 12 +++++ 5 files changed, 125 insertions(+), 23 deletions(-) create mode 100644 cluster-resources/backstage-keycloak-client-config.yaml create mode 100644 infra/values/upc-dev/backstage-values.yaml diff --git a/cluster-resources/backstage-keycloak-client-config.yaml b/cluster-resources/backstage-keycloak-client-config.yaml new file mode 100644 index 0000000..7bfd34f --- /dev/null +++ b/cluster-resources/backstage-keycloak-client-config.yaml @@ -0,0 +1,43 @@ +# Self-service Keycloak client config for Backstage. +# Kyverno clones this to the keycloak namespace, where the +# keycloak-client-registrar CronJob processes it and creates +# the backstage-oidc-credentials Secret in the backstage namespace. +apiVersion: v1 +kind: Secret +metadata: + name: keycloak-client-backstage + namespace: backstage + labels: + keycloak.forteapps.net/client-config: "true" +stringData: + client.json: | + { + "clientId": "backstage", + "name": "Backstage Developer Portal", + "redirectUris": ["https://backstage.forteapps.net/api/auth/oidc/handler/frame"], + "webOrigins": ["https://backstage.forteapps.net"], + "defaultClientScopes": ["openid", "email", "profile"], + "protocolMappers": [ + { + "name": "email_verified", + "protocol": "openid-connect", + "protocolMapper": "oidc-hardcoded-claim-mapper", + "config": { + "claim.name": "email_verified", + "claim.value": "true", + "jsonType.label": "boolean", + "id.token.claim": "true", + "access.token.claim": "true", + "userinfo.token.claim": "true" + } + } + ], + "secret": { + "namespace": "backstage", + "name": "backstage-oidc-credentials", + "keys": { + "clientId": "AUTH_OIDC_CLIENT_ID", + "clientSecret": "AUTH_OIDC_CLIENT_SECRET" + } + } + } diff --git a/docs/REFERENCE.md b/docs/REFERENCE.md index e722606..05e4c89 100644 --- a/docs/REFERENCE.md +++ b/docs/REFERENCE.md @@ -986,15 +986,18 @@ ignore: - Dynamic plugins: loads `dynamic-plugins.default.yaml` (all 27+ bundled plugins) - Catalog rules: Component, System, API, Resource, Location, Template, Group, User, Domain -**Dynamic Plugins**: -Add plugins at runtime via `global.dynamic.plugins` in values — no image rebuild: -```yaml -global: - dynamic: - plugins: - - package: "@scope/my-plugin@1.0.0" - integrity: "sha512-..." -``` +**Authentication** (Keycloak OIDC): +- Uses the self-service registrar pattern (see [Keycloak Client Registrar](#keycloak-client-registrar)) +- Config Secret: `cluster-resources/backstage-keycloak-client-config.yaml` +- Kyverno clones it → registrar creates `backstage-oidc-credentials` Secret in `backstage` namespace +- Credential keys: `AUTH_OIDC_CLIENT_ID`, `AUTH_OIDC_CLIENT_SECRET` (loaded via `extraEnvVarsSecrets`) +- Redirect URI: `https://backstage.forteapps.net/api/auth/oidc/handler/frame` +- Sign-in resolver: `emailMatchingUserEntityProfileEmail` + +**Catalog Discovery** (Gitea): +- Auto-discovers `catalog-info.yaml` from all repos in the `Forte` organization +- Scans every 30 minutes via the Gitea catalog provider plugin +- Gitea SCM integration configured for URL resolution (`git.forteapps.net`) **Catalog Registration**: Teams register services by adding a `catalog-info.yaml` to their repo root: @@ -1012,22 +1015,31 @@ spec: owner: team-name ``` -Then add the location to `backstage-values.yaml` under `upstream.backstage.appConfig.catalog.locations`. +Repos with this file are auto-discovered — no manual registration needed. -**Per-cluster Configuration**: -To set the ingress hostname, create a per-cluster overlay values file (e.g., `infra/values/upc-dev/backstage-values.yaml`) with: +**Dynamic Plugins**: +Add plugins at runtime via `global.dynamic.plugins` in values — no image rebuild: ```yaml global: - host: backstage.example.com + dynamic: + plugins: + - package: "@scope/my-plugin@1.0.0" + integrity: "sha512-..." +``` + +**Per-cluster Configuration** (`infra/values/upc-dev/backstage-values.yaml`): +```yaml +global: + host: backstage.forteapps.net upstream: backstage: appConfig: app: - baseUrl: https://backstage.example.com + baseUrl: https://backstage.forteapps.net backend: - baseUrl: https://backstage.example.com + baseUrl: https://backstage.forteapps.net ingress: - host: backstage.example.com + host: backstage.forteapps.net ``` ### Keycloak Client Registrar diff --git a/infra/base/backstage.yaml b/infra/base/backstage.yaml index 52de3f7..5130547 100644 --- a/infra/base/backstage.yaml +++ b/infra/base/backstage.yaml @@ -22,6 +22,7 @@ spec: releaseName: backstage valueFiles: - $values/infra/values/base/backstage-values.yaml + - $values/infra/values/upc-dev/backstage-values.yaml - repoURL: ssh://git@git.forteapps.net:2222/Forte/launchpad.git targetRevision: HEAD diff --git a/infra/values/base/backstage-values.yaml b/infra/values/base/backstage-values.yaml index 9edcb51..d425266 100644 --- a/infra/values/base/backstage-values.yaml +++ b/infra/values/base/backstage-values.yaml @@ -36,9 +36,12 @@ upstream: cpu: 1000m memory: 2560Mi + extraEnvVarsSecrets: + - backstage-oidc-credentials + appConfig: app: - title: "Forte Developer Portal" + title: "Forte Backstage" baseUrl: http://localhost:7007 backend: @@ -47,6 +50,27 @@ upstream: client: better-sqlite3 connection: ":memory:" + # -- Keycloak OIDC authentication + signInPage: oidc + auth: + environment: production + providers: + oidc: + production: + metadataUrl: https://id.forteapps.net/realms/forte/.well-known/openid-configuration + clientId: ${AUTH_OIDC_CLIENT_ID} + clientSecret: ${AUTH_OIDC_CLIENT_SECRET} + prompt: auto + signIn: + resolvers: + - resolver: emailMatchingUserEntityProfileEmail + + # -- Gitea SCM integration (for catalog URL resolution) + integrations: + gitea: + - host: git.forteapps.net + + # -- Software catalog catalog: rules: - allow: @@ -59,12 +83,22 @@ upstream: - Group - User - Domain - locations: [] - # Register components from Gitea repositories by adding: - # - type: url - # target: https://git.forteapps.net/Forte/my-repo/raw/branch/main/catalog-info.yaml - # rules: - # - allow: [Component, System, API] + providers: + # Auto-discover catalog-info.yaml from all Forte org repos + gitea: + forte: + organization: Forte + host: git.forteapps.net + catalogPath: catalog-info.yaml + schedule: + frequency: { minutes: 30 } + timeout: { minutes: 3 } + locations: + # Backstage's own org data (bootstrap teams, systems, domains) + # - type: url + # target: https://git.forteapps.net/Forte/backstage-catalog/raw/branch/main/org.yaml + # rules: + # - allow: [Group, User, System, Domain] ingress: enabled: true diff --git a/infra/values/upc-dev/backstage-values.yaml b/infra/values/upc-dev/backstage-values.yaml new file mode 100644 index 0000000..c0ffd25 --- /dev/null +++ b/infra/values/upc-dev/backstage-values.yaml @@ -0,0 +1,12 @@ +global: + host: backstage.forteapps.net + +upstream: + backstage: + appConfig: + app: + baseUrl: https://backstage.forteapps.net + backend: + baseUrl: https://backstage.forteapps.net + ingress: + host: backstage.forteapps.net -- 2.49.1 From 3fd3206d964efe1662c509328561e582b12fd6c0 Mon Sep 17 00:00:00 2001 From: Danijel Simeunovic Date: Thu, 23 Apr 2026 20:37:36 +0200 Subject: [PATCH 4/5] review token --- .gitea/workflows/ai-review.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/ai-review.yaml b/.gitea/workflows/ai-review.yaml index 808bb33..178a0ad 100644 --- a/.gitea/workflows/ai-review.yaml +++ b/.gitea/workflows/ai-review.yaml @@ -34,6 +34,7 @@ jobs: with: submodules: true fetch-depth: 0 + token: ${{ secrets.AI_REVIEW_TOKEN }} - name: Run inline review uses: docker://nikitafilonov/ai-review:v0.64.0 -- 2.49.1 From 1f67ccab3fc868fc9a19ffd3627660c1ab0b9b72 Mon Sep 17 00:00:00 2001 From: Danijel Simeunovic Date: Thu, 23 Apr 2026 20:43:17 +0200 Subject: [PATCH 5/5] cleanup --- infra/values/base/backstage-values.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/infra/values/base/backstage-values.yaml b/infra/values/base/backstage-values.yaml index d425266..652278d 100644 --- a/infra/values/base/backstage-values.yaml +++ b/infra/values/base/backstage-values.yaml @@ -46,9 +46,6 @@ upstream: backend: baseUrl: http://localhost:7007 - database: - client: better-sqlite3 - connection: ":memory:" # -- Keycloak OIDC authentication signInPage: oidc -- 2.49.1