Skip to content

Commit ea0243d

Browse files
authored
Merging Orchestrator with RHDH chart (#109)
* Orchestrator merged with backstage chart * Readme changes * changes to chart version and value lint issue * Changes after PR review * chart bump * updated plugins to correct versions * correct orchestrator plugins - official * network policy pod selection + servicebinding default * chart version bump * orchestrator value flattened * values json update * Exist check for sonataflowplatform * sonataflow job working for local psql * Integrates sonataflowplatform with external DB + readme instructions * making job image configurable * moved wait to init container * configurable images and comments * chart bump * chart bump to 3.5.0 * lint issues * bumped version to 4.0.0 * conditionals for templates and error messages
1 parent eed7951 commit ea0243d

14 files changed

Lines changed: 681 additions & 13 deletions

charts/backstage/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ sources:
4444
# This is the chart version. This version number should be incremented each time you make changes
4545
# to the chart and its templates, including the app version.
4646
# Versions are expected to follow Semantic Versioning (https://semver.org/)
47-
version: 3.4.0
47+
version: 4.0.0

charts/backstage/README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# RHDH Backstage Helm Chart for OpenShift (Community Version)
33

44
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/rhdh-chart&style=flat-square)](https://artifacthub.io/packages/search?repo=rhdh-chart)
5-
![Version: 3.4.0](https://img.shields.io/badge/Version-3.4.0-informational?style=flat-square)
5+
![Version: 4.0.0](https://img.shields.io/badge/Version-4.0.0-informational?style=flat-square)
66
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
77

88
A Helm chart for deploying Red Hat Developer Hub.
@@ -191,6 +191,20 @@ 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.enabled | | bool | `false` |
195+
| orchestrator.serverlessLogicOperator.enabled | | bool | `false` |
196+
| orchestrator.serverlessOperator.enabled | | bool | `false` |
197+
| orchestrator.sonataflowPlatform.createDBJobImage | Image for the container used by the create-db job | string | `"postgres:15"` |
198+
| orchestrator.sonataflowPlatform.eventing.broker.name | | string | `""` |
199+
| orchestrator.sonataflowPlatform.eventing.broker.namespace | | string | `""` |
200+
| orchestrator.sonataflowPlatform.externalDBName | Name for the user-configured external Database | string | `""` |
201+
| orchestrator.sonataflowPlatform.externalDBsecretRef | Secret name for the user-created secret to connect an external DB | string | `""` |
202+
| orchestrator.sonataflowPlatform.initContainerImage | Image for the init container used by the create-db job | string | `"busybox"` |
203+
| orchestrator.sonataflowPlatform.monitoring.enabled | | bool | `true` |
204+
| orchestrator.sonataflowPlatform.resources.limits.cpu | | string | `"500m"` |
205+
| orchestrator.sonataflowPlatform.resources.limits.memory | | string | `"1Gi"` |
206+
| orchestrator.sonataflowPlatform.resources.requests.cpu | | string | `"250m"` |
207+
| orchestrator.sonataflowPlatform.resources.requests.memory | | string | `"64Mi"` |
194208
| 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"}` |
195209
| route.annotations | Route specific annotations | object | `{}` |
196210
| route.enabled | Enable the creation of the route resource | bool | `true` |
@@ -320,3 +334,30 @@ upstream:
320334
volumePermissions:
321335
enabled: true
322336
```
337+
338+
## Installing RHDH with Orchestrator
339+
340+
Orchestrator brings serverless workflows into Backstage, focusing on the journey for application migration to the cloud, on boarding developers ,and user-made workflows of Backstage actions or external systems.
341+
Orchestrator is a flavor of RHDH, and can be installed alongside the RHDH in the same namespace and in the folloing way:
342+
343+
1. Have an admin install the orchestrator-infra helm chart, which will install the pre-requisites required to install RHDH flavored Orchestrator. This proccess will include installing cluster-wide resources, so should be done with admin privileges
344+
```
345+
helm install <release_name> charts/orchestrator-infra
346+
```
347+
2. Manually approve the Install Plans created by the chart, and wait for the Openshift Serverless and Openshift Serverless Logic Operators to be deployed.
348+
3. Install backstage chart with helm, setting orchestrator to be enabled.
349+
4. Enable serverlessLogicOperator and serverlessOperator in the backstage values.
350+
351+
To use orchestrator with an external DB, please follow the instructions in [our documentation](https://github.com/redhat-developer/rhdh-chart/blob/main/docs/external-db.md)
352+
and populate the following values in the values.yaml:
353+
```bash
354+
externalDBsecretRef: <cred-secret>
355+
externalDBName: ""
356+
```
357+
Please note that externalDBName is the name of the user-configured existing database, not the database that orchestrator and sonataflow resources will use.
358+
359+
Finally, install the helm chart:
360+
```
361+
helm install <release_name> charts/backstage --set orchestrator.enabled=true --set orchestrator.serverlessLogicOperator.enabled=true --set orchestrator.serverlessOperator.enabled=true \
362+
--set externalDBsecretRef=<cred-secret> --set externalDBName=example
363+
```

charts/backstage/README.md.gotmpl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,3 +269,30 @@ upstream:
269269
volumePermissions:
270270
enabled: true
271271
```
272+
273+
## Installing RHDH with Orchestrator
274+
275+
Orchestrator brings serverless workflows into Backstage, focusing on the journey for application migration to the cloud, on boarding developers ,and user-made workflows of Backstage actions or external systems.
276+
Orchestrator is a flavor of RHDH, and can be installed alongside the RHDH in the same namespace and in the folloing way:
277+
278+
1. Have an admin install the orchestrator-infra helm chart, which will install the pre-requisites required to install RHDH flavored Orchestrator. This proccess will include installing cluster-wide resources, so should be done with admin privileges
279+
```
280+
helm install <release_name> charts/orchestrator-infra
281+
```
282+
2. Manually approve the Install Plans created by the chart, and wait for the Openshift Serverless and Openshift Serverless Logic Operators to be deployed.
283+
3. Install backstage chart with helm, setting orchestrator to be enabled.
284+
4. Enable serverlessLogicOperator and serverlessOperator in the backstage values.
285+
286+
To use orchestrator with an external DB, please follow the instructions in [our documentation](https://github.com/redhat-developer/rhdh-chart/blob/main/docs/external-db.md)
287+
and populate the following values in the values.yaml:
288+
```bash
289+
externalDBsecretRef: <cred-secret>
290+
externalDBName: ""
291+
```
292+
Please note that externalDBName is the name of the user-configured existing database, not the database that orchestrator and sonataflow resources will use.
293+
294+
Finally, install the helm chart:
295+
```
296+
helm install <release_name> charts/backstage --set orchestrator.enabled=true --set orchestrator.serverlessLogicOperator.enabled=true --set orchestrator.serverlessOperator.enabled=true \
297+
--set externalDBsecretRef=<cred-secret> --set externalDBName=example
298+
```

charts/backstage/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ Referenced from: https://github.com/bitnami/charts/blob/main/bitnami/postgresql/
4747
{{- else -}}
4848
{{- printf "%s" (include "common.names.fullname" .) -}}
4949
{{- end -}}
50-
{{- end -}}
50+
{{- end -}}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{{- define "orchestrator.plugins" }}
2+
{{- $config := include "orchestrator.plugins.config" . | fromYaml }}
3+
plugins:
4+
- disabled: false
5+
package: "{{ $config.orchestratorPlugins.scope }}/{{ $config.orchestratorPlugins.orchestratorBackend.package }}"
6+
integrity: "{{ $config.orchestratorPlugins.orchestratorBackend.integrity }}"
7+
pluginConfig:
8+
orchestrator:
9+
dataIndexService:
10+
url: http://sonataflow-platform-data-index-service.{{ .Release.Namespace }}
11+
- disabled: false
12+
package: "{{ $config.orchestratorPlugins.scope }}/{{ $config.orchestratorPlugins.orchestrator.package }}"
13+
integrity: "{{ $config.orchestratorPlugins.orchestrator.integrity }}"
14+
pluginConfig:
15+
dynamicPlugins:
16+
frontend:
17+
red-hat-developer-hub.backstage-plugin-orchestrator:
18+
appIcons:
19+
- importName: OrchestratorIcon
20+
module: OrchestratorPlugin
21+
name: orchestratorIcon
22+
dynamicRoutes:
23+
- importName: OrchestratorPage
24+
menuItem:
25+
icon: orchestratorIcon
26+
text: Orchestrator
27+
module: OrchestratorPlugin
28+
path: /orchestrator
29+
- disabled: true
30+
package: "{{ $config.orchestratorPlugins.scope }}/{{ $config.orchestratorPlugins.scaffolderBackendOrchestrator.package }}"
31+
integrity: "{{ $config.orchestratorPlugins.scaffolderBackendOrchestrator.integrity }}"{{- end }}
32+
pluginConfig:
33+
orchestrator:
34+
dataIndexService:
35+
url: http://sonataflow-platform-data-index-service.{{ .Release.Namespace }}
36+
37+
{{- define "orchestrator.plugins.config" }}
38+
orchestratorPlugins:
39+
scope: "@redhat"
40+
orchestrator:
41+
package: "backstage-plugin-orchestrator@1.5.1"
42+
integrity: sha512-7VOe+XGTUzrdO/av0DNHbydOjB3Lo+XdCs6fj3JVODLP7Ypd3GXHf/nssYxG5ZYC9F1t9MNeguE2bZOB6ckqTA==
43+
orchestratorBackend:
44+
package: "backstage-plugin-orchestrator-backend-dynamic@1.5.1"
45+
integrity: sha512-VIenFStdq9QvvmgmEMG8O7b2wqIebvEcqNeJ9SWZ8jen9t+efTK6D3Rde74LQ1no1QaHLx8RoxNCOuTUEF8O/g==
46+
scaffolderBackendOrchestrator:
47+
package: "backstage-plugin-scaffolder-backend-module-orchestrator-dynamic@1.5.1"
48+
integrity: sha512-bnVQjVsUZ470Vgm2kd5Lo/bVa2fF0q4GufBDc/8oTQsnP3zZJQqKFvFElBTCjY76RqkECydlvZ1UFybSzvockQ==
49+
{{- end }}

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

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,33 @@ metadata:
44
name: {{ printf "%s-dynamic-plugins" .Release.Name }}
55
data:
66
dynamic-plugins.yaml: |
7-
{{- include "common.tplvalues.render" ( dict "value"
8-
.Values.global.dynamic "context" $) | nindent 4 }}
7+
{{- $dynamic := deepCopy .Values.global.dynamic }}
8+
{{- $plugins := list }}
9+
10+
{{- range .Values.global.dynamic.plugins }}
11+
{{- $plugins = append $plugins . }}
12+
{{- end }}
13+
14+
{{- if .Values.orchestrator.enabled }}
15+
{{- $orchestratorPlugins := include "orchestrator.plugins" . | fromYaml }}
16+
{{- range $orchestratorPlugins.plugins }}
17+
{{- $plugins = append $plugins . }}
18+
{{- end }}
19+
{{- end }}
20+
21+
{{- $_ := set $dynamic "plugins" $plugins }}
22+
23+
{{- include "common.tplvalues.render" (dict "value" $dynamic "context" $) | nindent 4 }}
24+
25+
---
26+
{{- if .Values.orchestrator.enabled }}
27+
apiVersion: v1
28+
kind: Secret
29+
metadata:
30+
name: {{ .Release.Name}}-dynamic-plugins-npmrc
31+
namespace: {{ .Release.Namespace }}
32+
type: Opaque
33+
stringData:
34+
.npmrc: |
35+
@redhat:registry=https://npm.registry.redhat.com
36+
{{- end }}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{{- if and .Values.orchestrator.enabled .Values.orchestrator.serverlessLogicOperator.enabled }}
2+
apiVersion: networking.k8s.io/v1
3+
kind: NetworkPolicy
4+
metadata:
5+
name: {{ .Release.Name }}-allow-knative-to-sonataflow-and-workflows
6+
# Sonataflow and Workflows are using the RHDH target namespace.
7+
namespace: {{ .Release.Namespace | quote }}
8+
spec:
9+
podSelector: {}
10+
ingress:
11+
- from:
12+
- namespaceSelector:
13+
matchLabels:
14+
# Allow knative events to be delivered to workflows.
15+
kubernetes.io/metadata.name: knative-eventing
16+
- namespaceSelector:
17+
matchLabels:
18+
# Allow auxiliary knative function for workflow (such as m2k-save-transformation)
19+
kubernetes.io/metadata.name: knative-serving
20+
---
21+
# NetworkPolicy to unblock incoming traffic to the namespace
22+
apiVersion: networking.k8s.io/v1
23+
kind: NetworkPolicy
24+
metadata:
25+
name: {{ .Release.Name }}-allow-external-communication
26+
namespace: {{ .Release.Namespace | quote }}
27+
spec:
28+
podSelector: {}
29+
ingress:
30+
- from:
31+
- namespaceSelector:
32+
matchLabels:
33+
# Allow knative events to be delivered to workflows.
34+
kubernetes.io/metadata.name: openshift-ingress
35+
---
36+
apiVersion: networking.k8s.io/v1
37+
kind: NetworkPolicy
38+
metadata:
39+
name: {{ .Release.Name }}-allow-intra-network
40+
namespace: {{ .Release.Namespace | quote }}
41+
spec:
42+
# Apply this policy to all pods in the namespace
43+
podSelector: {}
44+
# Specify policy type as 'Ingress' to control incoming traffic rules
45+
policyTypes:
46+
- Ingress
47+
ingress:
48+
- from:
49+
# Allow ingress from any pod within the same namespace
50+
- podSelector: {}
51+
52+
53+
{{- end }}
54+
---
55+
{{- if and .Values.orchestrator.enabled .Values.orchestrator.sonataflowPlatform.monitoring.enabled }}
56+
# NetworkPolicy to allow openshift-user-workload-monitoring pods to access all pods within the workflow's namespace
57+
apiVersion: networking.k8s.io/v1
58+
kind: NetworkPolicy
59+
metadata:
60+
name: {{ .Release.Name }}-allow-monitoring-to-sonataflow-and-workflows
61+
namespace: {{ .Release.Namespace | quote }}
62+
spec:
63+
# Apply this policy to all pods in the namespace
64+
podSelector: {}
65+
# Specify policy type as 'Ingress' to control incoming traffic rules
66+
policyTypes:
67+
- Ingress
68+
ingress:
69+
- from:
70+
- namespaceSelector:
71+
matchLabels:
72+
# Allow openshift-user-workload-monitoring pods to access the workflow.
73+
kubernetes.io/metadata.name: openshift-user-workload-monitoring
74+
{{- end }}

0 commit comments

Comments
 (0)