Skip to content

Commit c66621f

Browse files
committed
Adding orchestrator dynamic plugins, updated values, app config, readme
1 parent 50f79f1 commit c66621f

8 files changed

Lines changed: 245 additions & 342 deletions

File tree

charts/backstage/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,44 @@ Kubernetes: `>= 1.25.0-0`
191191
| 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"` |
192192
| 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 | `[]` |
193193
| global.host | Custom hostname shorthand, overrides `global.clusterRouterBase`, `upstream.ingress.host`, `route.host`, and url values in `upstream.backstage.appConfig`. | string | `""` |
194+
| orchestrator.argocd.enabled | | bool | `false` |
195+
| orchestrator.argocd.namespace | | string | `""` |
196+
| orchestrator.enabled | | bool | `true` |
197+
| orchestrator.networkPolicy.rhdhNamespace | | string | `""` |
198+
| orchestrator.orchestrator.namespace | | string | `""` |
199+
| orchestrator.orchestrator.sonataflowPlatform.eventing.broker.name | | string | `""` |
200+
| orchestrator.orchestrator.sonataflowPlatform.eventing.broker.namespace | | string | `""` |
201+
| orchestrator.orchestrator.sonataflowPlatform.monitoring.enabled | | bool | `true` |
202+
| orchestrator.orchestrator.sonataflowPlatform.resources.limits.cpu | | string | `"500m"` |
203+
| orchestrator.orchestrator.sonataflowPlatform.resources.limits.memory | | string | `"1Gi"` |
204+
| orchestrator.orchestrator.sonataflowPlatform.resources.requests.cpu | | string | `"250m"` |
205+
| orchestrator.orchestrator.sonataflowPlatform.resources.requests.memory | | string | `"64Mi"` |
206+
| orchestrator.postgres.authSecret.name | | string | `"sonataflow-psql-postgresql"` |
207+
| orchestrator.postgres.authSecret.passwordKey | | string | `"postgres-password"` |
208+
| orchestrator.postgres.authSecret.userKey | | string | `"postgres-username"` |
209+
| orchestrator.postgres.database | | string | `"sonataflow"` |
210+
| orchestrator.postgres.serviceName | | string | `"sonataflow-psql-postgresql"` |
211+
| orchestrator.postgres.serviceNamespace | | string | `""` |
212+
| orchestrator.rhdhOperator.catalogBranch | | string | `"v1.4.x"` |
213+
| orchestrator.rhdhOperator.enableGuestProvider | | bool | `false` |
214+
| orchestrator.rhdhOperator.enabled | | bool | `true` |
215+
| orchestrator.rhdhOperator.secretRef.backstage.backendSecret | | string | `"{{ .Values.global.auth.value }}"` |
216+
| orchestrator.rhdhOperator.secretRef.k8s.clusterToken | | string | `"K8S_CLUSTER_TOKEN"` |
217+
| orchestrator.rhdhOperator.secretRef.k8s.clusterUrl | | string | `"K8S_CLUSTER_URL"` |
218+
| orchestrator.rhdhOperator.secretRef.name | | string | `"backstage-backend-auth-secret"` |
219+
| orchestrator.rhdhPlugins.notificationsEmail.enabled | | bool | `false` |
220+
| orchestrator.rhdhPlugins.notificationsEmail.port | | int | `587` |
221+
| orchestrator.rhdhPlugins.notificationsEmail.replyTo | | string | `""` |
222+
| orchestrator.rhdhPlugins.notificationsEmail.sender | | string | `""` |
223+
| orchestrator.rhdhPlugins.npmRegistry | | string | `""` |
224+
| orchestrator.rhdhPlugins.orchestrator.integrity | | string | `"sha512-Vclb+TIL8cEtf9G2nx0UJ+kMJnCGZuYG/Xcw0Otdo/fZGuynnoCaAZ6rHnt4PR6LerekHYWNUbzM3X+AVj5cwg=="` |
225+
| orchestrator.rhdhPlugins.orchestrator.package | | string | `"backstage-plugin-orchestrator-1.4.0-rc.7.tgz"` |
226+
| orchestrator.rhdhPlugins.orchestratorBackend.integrity | | string | `"sha512-bxD0Au2V9BeUMcZBfNYrPSQ161vmZyKwm6Yik5keZZ09tenkc8fNjipwJsWVFQCDcAOOxdBAE0ibgHtddl3NKw=="` |
227+
| orchestrator.rhdhPlugins.orchestratorBackend.package | | string | `"backstage-plugin-orchestrator-backend-dynamic-1.4.0-rc.7.tgz"` |
228+
| orchestrator.rhdhPlugins.scope | | string | `"https://github.com/rhdhorchestrator/orchestrator-plugins-internal-release/releases/download/1.4.0"` |
229+
| orchestrator.serverlessOperator.enabled | | bool | `true` |
230+
| orchestrator.sonataFlowOperator.enabled | | bool | `true` |
231+
| orchestrator.tekton.enabled | | bool | `false` |
194232
| 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"}` |
195233
| route.annotations | Route specific annotations | object | `{}` |
196234
| route.enabled | Enable the creation of the route resource | bool | `true` |

charts/backstage/templates/_helpers.tpl

Lines changed: 0 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ Referenced from: https://github.com/bitnami/charts/blob/main/bitnami/postgresql/
8787
{{- end -}}
8888
{{- end -}}
8989

90-
9190
{{- define "cluster.domain" -}}
9291
{{- if .Capabilities.APIVersions.Has "config.openshift.io/v1/Ingress" -}}
9392
{{- $cluster := (lookup "config.openshift.io/v1" "Ingress" "" "cluster") -}}
@@ -101,100 +100,3 @@ Referenced from: https://github.com/bitnami/charts/blob/main/bitnami/postgresql/
101100
{{- end -}}
102101
{{- end -}}
103102

104-
105-
{{- define "install-tekton-task" -}}
106-
{{- if and (and (and .Values.orchestrator.tekton.enabled .Values.orchestrator.argocd.enabled) (ne .Values.orchestrator.rhdhOperator.secretRef.k8s.clusterToken "")) (.Capabilities.APIVersions.Has "tekton.dev/v1/Task") }}
107-
{{- "true" -}}
108-
{{- else }}
109-
{{- "false" -}}
110-
{{- end -}}
111-
{{- end -}}
112-
113-
{{- define "install-tekton-pipeline" -}}
114-
{{- if and (and (and .Values.orchestrator.tekton.enabled .Values.orchestrator.argocd.enabled) (ne .Values.orchestrator.rhdhOperator.secretRef.k8s.clusterToken "")) (.Capabilities.APIVersions.Has "tekton.dev/v1/Pipeline") }}
115-
{{- "true" -}}
116-
{{- else }}
117-
{{- "false" -}}
118-
{{- end -}}
119-
{{- end -}}
120-
121-
{{- define "install-argocd-project" -}}
122-
{{- if and (.Values.orchestrator.argocd.enabled) (.Capabilities.APIVersions.Has "argoproj.io/v1alpha1/AppProject") }}
123-
{{- "true" -}}
124-
{{- else }}
125-
{{- "false" -}}
126-
{{- end -}}
127-
{{- end -}}
128-
129-
130-
{{- define "get-namespace-with-label" -}}
131-
{{- $paramValue:= index . 0 -}}
132-
{{- $matchingLabel:= index . 1 -}}
133-
{{- if $paramValue -}}
134-
{{- $paramValue -}}
135-
{{- else -}}
136-
{{- $ns:= "" }}
137-
{{- $list:= lookup "v1" "Namespace" "" "" -}}
138-
{{- if eq 0 (len (dig "items" (dict "" "") $list ) )}}
139-
{{- fail (printf "No namespaces found: %d" (len (dig "items" (dict "" "") $list)) ) }}
140-
{{- end -}}
141-
{{- range (dig "items" (dict "" "") $list) }}
142-
{{- $labels:= dig "metadata" "labels" (dict "" "" ) . -}}
143-
{{- if (hasKey $labels $matchingLabel ) }}
144-
{{- if not $ns }}
145-
{{- $ns = dig "metadata" "name" "" . -}}
146-
{{- else -}}
147-
{{- fail (printf "More than one namespace found with label %s: %s and %s" $matchingLabel $ns (dig "metadata" "name" "" .) )}}
148-
{{- end }}
149-
{{- end -}}
150-
{{- end -}}
151-
{{- if not $ns -}}
152-
{{- fail (printf "No namespace found with label '%s'. Please follow the installation instructions to properly configure the environment" $matchingLabel) -}}
153-
{{- end }}
154-
{{- $ns }}
155-
{{- end -}}
156-
{{- end -}}
157-
158-
{{- define "get-workflow-namespace" -}}
159-
{{- if (not (hasKey . "workflowNamespace" ) ) -}}
160-
{{- $workflowNamespace := include "get-namespace-with-label" (list .Values.orchestrator.orchestrator.namespace "rhdh.redhat.com/workflow-namespace") }}
161-
{{- $_ := set . "workflowNamespace" $workflowNamespace }}
162-
{{- end -}}
163-
{{- .workflowNamespace -}}
164-
{{- end -}}
165-
166-
{{- define "get-argocd-namespace" -}}
167-
{{- if .Values.orchestrator.argocd.enabled }}
168-
{{- if (not (hasKey . "argoCDNamespace" ) ) -}}
169-
{{- $argoCDNamespace := include "get-namespace-with-label" (list .Values.orchestrator.argocd.namespace "rhdh.redhat.com/argocd-namespace") }}
170-
{{- $_ := set . "argoCDNamespace" $argoCDNamespace }}
171-
{{- end -}}
172-
{{- .argoCDNamespace -}}
173-
{{- end -}}
174-
{{- end -}}
175-
176-
{{- define "get-cluster-version" -}}
177-
{{- $v := "" }}
178-
{{- $version :=(lookup "config.openshift.io/v1" "ClusterVersion" "" "version") }}
179-
{{- range $version.status.history }}
180-
{{- if eq .state "Completed" }}
181-
{{- $v = (semver .version) }}
182-
{{- end }}
183-
{{- end }}
184-
185-
{{- $validMinors := list "4.13" "4.14" "4.15" "4.16" -}}
186-
{{- $versionString := printf "%d.%d" $v.Major $v.Minor -}}
187-
{{- if not (semverCompare ">=4.13 <=4.16" $versionString) -}}
188-
{{- fail (printf "Unsupported OCP version: %s. Supported versions: %s." $versionString $validMinors) -}}
189-
{{- end -}}
190-
{{- $versionString -}}
191-
{{- end -}}
192-
193-
{{- define "get-tekton-version" -}}
194-
{{- $pipelinesSubs := lookup "operators.coreos.com/v1alpha1" "Subscription" "openshift-operators" "openshift-pipelines-operator-rh" -}}
195-
{{- $pipelineInstalledVersion := $pipelinesSubs.status.installedCSV}}
196-
{{- $pipelineVersion := substr 33 ( len $pipelineInstalledVersion) $pipelineInstalledVersion}}
197-
{{- $pipelineVersion = semver $pipelineVersion }}
198-
{{- $pipelineVersionString := printf "%d.%d" $pipelineVersion.Major $pipelineVersion.Minor -}}
199-
{{- $pipelineVersionString -}}
200-
{{- end -}}

charts/backstage/templates/dynamic-plugins-configmap.yaml

Lines changed: 165 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,169 @@ kind: ConfigMap
33
metadata:
44
name: {{ printf "%s-dynamic-plugins" .Release.Name }}
55
data:
6+
{{- $dynamic := .Values.global.dynamic }}
7+
{{- $plugins := .Values.global.dynamic.plugins }}
68
dynamic-plugins.yaml: |
7-
{{- include "common.tplvalues.render" ( dict "value"
8-
.Values.global.dynamic "context" $) | nindent 4 }}
9+
{{- if .Values.orchestrator.enabled }}
10+
{{- $orchestratorPlugins := include "orchestrator.plugins" . | fromYaml }}
11+
{{- range $orchestratorPlugins.plugins }}
12+
{{- $plugins = append $plugins . }}
13+
{{- end }}
14+
{{- $dynamic = merge $dynamic (dict "plugins" $plugins) }}
15+
{{- end }}
16+
{{- include "common.tplvalues.render" (dict "value" $dynamic "context" $) | nindent 4 }}
17+
18+
{{- if .Values.orchestrator.enabled }}
19+
---
20+
apiVersion: v1
21+
kind: Secret
22+
metadata:
23+
name: dynamic-plugins-npmrc
24+
namespace: {{ .Release.Namespace | quote }}
25+
type: Opaque
26+
stringData:
27+
.npmrc: |
28+
registry={{ .Values.orchestrator.rhdhPlugins.npmRegistry }}
29+
{{- end }}
30+
---
31+
{{- define "orchestrator.plugins" }}
32+
{{- $secret := lookup "v1" "Secret" .Release.Namespace .Values.orchestrator.rhdhOperator.secretRef.name }}
33+
plugins:
34+
{{- if and
35+
(and .Values.orchestrator.rhdhOperator.secretRef.k8s.clusterToken
36+
(dig "data" .Values.orchestrator.rhdhOperator.secretRef.k8s.clusterToken "" $secret ) )
37+
(and .Values.orchestrator.rhdhOperator.secretRef.k8s.clusterUrl
38+
(dig "data" .Values.orchestrator.rhdhOperator.secretRef.k8s.clusterUrl "" $secret ) )
39+
}}
40+
- package: ./dynamic-plugins/dist/backstage-plugin-kubernetes-backend-dynamic
41+
disabled: false
42+
pluginConfig:
43+
kubernetes:
44+
customResources:
45+
- group: 'tekton.dev'
46+
apiVersion: 'v1'
47+
plural: 'pipelines'
48+
- group: 'tekton.dev'
49+
apiVersion: 'v1'
50+
plural: 'pipelineruns'
51+
- group: 'tekton.dev'
52+
apiVersion: 'v1'
53+
plural: 'taskruns'
54+
- group: 'route.openshift.io'
55+
apiVersion: 'v1'
56+
plural: 'routes'
57+
serviceLocatorMethod:
58+
type: 'multiTenant'
59+
clusterLocatorMethods:
60+
- type: 'config'
61+
clusters:
62+
- name: 'Default Cluster'
63+
url: {{ printf "${%s}" .Values.orchestrator.rhdhOperator.secretRef.k8s.clusterUrl }}
64+
authProvider: 'serviceAccount'
65+
skipTLSVerify: true
66+
serviceAccountToken: {{ printf "${%s}" .Values.orchestrator.rhdhOperator.secretRef.k8s.clusterToken }}
67+
- package: ./dynamic-plugins/dist/backstage-plugin-kubernetes
68+
disabled: false
69+
{{- if .Values.orchestrator.tekton.enabled }}
70+
- package: ./dynamic-plugins/dist/backstage-community-plugin-tekton
71+
disabled: false
72+
{{- end }}
73+
{{- end }}
74+
{{- if and .Values.orchestrator.argocd.enabled
75+
( and
76+
(and (.Values.orchestrator.rhdhOperator.secretRef.argocd.url) (dig "data" .Values.orchestrator.rhdhOperator.secretRef.argocd.url "" $secret ) )
77+
(and (.Values.orchestrator.rhdhOperator.secretRef.argocd.username) (dig "data" .Values.orchestrator.rhdhOperator.secretRef.argocd.password "" $secret) )
78+
)
79+
}}
80+
- disabled: false
81+
package: ./dynamic-plugins/dist/backstage-community-plugin-redhat-argocd
82+
- disabled: false
83+
package: ./dynamic-plugins/dist/roadiehq-backstage-plugin-argo-cd-backend-dynamic
84+
- disabled: false
85+
package: ./dynamic-plugins/dist/roadiehq-scaffolder-backend-argocd-dynamic
86+
{{- end }}
87+
- disabled: false
88+
package: "{{ .Values.orchestrator.rhdhPlugins.scope }}/{{ .Values.orchestrator.rhdhPlugins.orchestratorBackend.package }}"
89+
integrity: {{ .Values.orchestrator.rhdhPlugins.orchestratorBackend.integrity }}
90+
pluginConfig:
91+
orchestrator:
92+
dataIndexService:
93+
url: http://sonataflow-platform-data-index-service.{{ .Release.Namespace }}
94+
- disabled: false
95+
package: "{{ .Values.orchestrator.rhdhPlugins.scope }}/{{ .Values.orchestrator.rhdhPlugins.orchestrator.package }}"
96+
integrity: {{ .Values.orchestrator.rhdhPlugins.orchestrator.integrity }}
97+
pluginConfig:
98+
dynamicPlugins:
99+
frontend:
100+
red-hat-developer-hub.backstage-plugin-orchestrator:
101+
appIcons:
102+
- importName: OrchestratorIcon
103+
module: OrchestratorPlugin
104+
name: orchestratorIcon
105+
dynamicRoutes:
106+
- importName: OrchestratorPage
107+
menuItem:
108+
icon: orchestratorIcon
109+
text: Orchestrator
110+
module: OrchestratorPlugin
111+
path: /orchestrator
112+
- disabled: false
113+
package: ./dynamic-plugins/dist/backstage-plugin-notifications
114+
pluginConfig:
115+
dynamicPlugins:
116+
frontend:
117+
backstage.plugin-notifications:
118+
dynamicRoutes:
119+
- importName: NotificationsPage
120+
menuItem:
121+
config:
122+
props:
123+
titleCounterEnabled: true
124+
webNotificationsEnabled: false
125+
importName: NotificationsSidebarItem
126+
path: /notifications
127+
- disabled: false
128+
package: ./dynamic-plugins/dist/backstage-plugin-signals
129+
pluginConfig:
130+
dynamicPlugins:
131+
frontend:
132+
backstage.plugin-signals: {}
133+
- disabled: false
134+
package: ./dynamic-plugins/dist/backstage-plugin-notifications-backend-dynamic
135+
- disabled: false
136+
package: ./dynamic-plugins/dist/backstage-plugin-signals-backend-dynamic
137+
- disabled: false
138+
package: ./dynamic-plugins/dist/backstage-plugin-scaffolder-backend-module-github-dynamic
139+
{{- if and .Values.orchestrator.rhdhPlugins.notificationsEmail.enabled
140+
( and (.Values.orchestrator.rhdhOperator.secretRef.notificationsEmail.hostname) (dig "data" .Values.orchestrator.rhdhOperator.secretRef.notificationsEmail.hostname "" $secret ) )
141+
}}
142+
- disabled: false
143+
package: ./dynamic-plugins/dist/backstage-plugin-notifications-backend-module-email-dynamic
144+
pluginConfig:
145+
notifications:
146+
processors:
147+
email:
148+
transportConfig:
149+
transport: smtp
150+
hostname: {{ printf "${%s}" .Values.orchestrator.rhdhOperator.secretRef.notificationsEmail.hostname }}
151+
port: {{ .Values.orchestrator.rhdhPlugins.notificationsEmail.port }}
152+
secure: false
153+
{{- if .Values.orchestrator.rhdhOperator.secretRef.notificationsEmail.username }}
154+
username: {{ printf "${%s}" .Values.orchestrator.rhdhOperator.secretRef.notificationsEmail.username }}
155+
{{- end}}
156+
{{- if .Values.orchestrator.rhdhOperator.secretRef.notificationsEmail.password }}
157+
password: {{ printf "${%s}" .Values.orchestrator.rhdhOperator.secretRef.notificationsEmail.password }}
158+
{{- end}}
159+
sender: {{ .Values.orchestrator.rhdhPlugins.notificationsEmail.sender }}
160+
{{- if .Values.orchestrator.rhdhPlugins.notificationsEmail.replyTo }}
161+
replyTo: {{ .Values.orchestrator.rhdhPlugins.notificationsEmail.replyTo }}
162+
{{- end}}
163+
broadcastConfig:
164+
receiver: "none"
165+
concurrencyLimit: 10
166+
cache:
167+
ttl:
168+
days: 1
169+
{{- end }}
170+
{{- $unmanagedNamespaceExists := include "unmanaged-resource-exists" (list "rhdh.redhat.com/v1alpha1" "Backstage" .Release.Namespace "backstage" .Release.Name .Capabilities.APIVersions ) }}
171+
{{- end }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{- if .Values.orchestrator.enabled }}
2+
---
3+
apiVersion: operator.knative.dev/v1beta1
4+
kind: KnativeServing
5+
metadata:
6+
name: knative-serving
7+
namespace: knative-serving
8+
annotations:
9+
"meta.helm.sh/release-name": {{ .Release.Name }}
10+
spec:
11+
controller-custom-certs:
12+
name: ""
13+
type: ""
14+
registry: {}
15+
---
16+
apiVersion: operator.knative.dev/v1beta1
17+
kind: KnativeEventing
18+
metadata:
19+
name: knative-eventing
20+
namespace: knative-eventing
21+
annotations:
22+
"meta.helm.sh/release-name": {{ .Release.Name }}
23+
spec:
24+
Registry:
25+
{{- end }}

charts/backstage/templates/network-policies.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{{- if .Values.orchestrator.enabled }}
21
{{- if .Values.orchestrator.sonataFlowOperator.enabled }}
32
apiVersion: networking.k8s.io/v1
43
kind: NetworkPolicy
@@ -72,5 +71,4 @@ spec:
7271
matchLabels:
7372
# Allow openshift-user-workload-monitoring pods to access the workflow.
7473
kubernetes.io/metadata.name: openshift-user-workload-monitoring
75-
{{- end }}
7674
{{- end }}

0 commit comments

Comments
 (0)