Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
e24df93
add plugin deps
gazarenkov Apr 11, 2025
f638e70
Merge remote-tracking branch 'upstream/main' into plugin-deps
gazarenkov Apr 11, 2025
e59b1b9
infra
gazarenkov Apr 16, 2025
7afab08
fix no plugin-deps dir
gazarenkov Apr 16, 2025
2a4d591
no traversing on plugin-deps dir
gazarenkov Apr 16, 2025
22aff07
fix make run
gazarenkov Apr 16, 2025
593c416
fixes, sonataflow version
gazarenkov Apr 21, 2025
8556918
fixes, sonataflow version
gazarenkov Apr 21, 2025
ac425af
Merge remote-tracking branch 'upstream/main' into plugin-deps
gazarenkov Apr 21, 2025
29abd82
add platform
gazarenkov Apr 23, 2025
c662f90
Regenerate bundle/installer manifests
github-actions[bot] Apr 23, 2025
633fa0c
Merge remote-tracking branch 'upstream/main' into plugin-deps
gazarenkov Apr 24, 2025
08ea36d
plugin-infra target and dependencies on dynamic-plugins.yaml
gazarenkov Apr 25, 2025
5ceac55
initial docs
gazarenkov Apr 29, 2025
bbf6b87
Merge remote-tracking branch 'origin/plugin-deps' into plugin-deps
gazarenkov Apr 29, 2025
5d3b7d4
Regenerate bundle/installer manifests
github-actions[bot] Apr 29, 2025
2c90706
docs
gazarenkov Apr 29, 2025
ecc53d9
Merge remote-tracking branch 'origin/plugin-deps' into plugin-deps
gazarenkov Apr 29, 2025
fd3c0f3
removed sample-greetings
gazarenkov Apr 29, 2025
f2c6bea
disabled orch plugin
gazarenkov Apr 29, 2025
fc526dc
fix dynamic-plugins
gazarenkov Apr 29, 2025
87dc7fa
orch doc and example
gazarenkov May 1, 2025
020c49a
Merge remote-tracking branch 'upstream/main' into plugin-deps
gazarenkov May 1, 2025
6b6c5fb
merge
gazarenkov May 1, 2025
817a52f
fix pluginsFromConfigMap
gazarenkov May 1, 2025
99f2862
fix kustomization.yaml
gazarenkov May 1, 2025
5db5538
Regenerate bundle/installer manifests
github-actions[bot] May 1, 2025
a3159ae
simplify profile structure
gazarenkov May 2, 2025
b9d56d9
Merge remote-tracking branch 'origin/plugin-deps' into plugin-deps
gazarenkov May 2, 2025
3f52161
Regenerate bundle/installer manifests
github-actions[bot] May 2, 2025
27d7899
fixes
gazarenkov May 5, 2025
9c33278
Merge remote-tracking branch 'origin/plugin-deps' into plugin-deps
gazarenkov May 5, 2025
1dffcc3
fixe
gazarenkov May 6, 2025
beacbb5
fix doc
gazarenkov May 6, 2025
d05219a
fix doc
gazarenkov May 6, 2025
0b2b12e
bundle
gazarenkov May 9, 2025
1f95234
check plugin-infra dir
gazarenkov May 9, 2025
ea98c6a
simplify config
gazarenkov May 12, 2025
2d95890
Regenerate bundle/installer manifests
github-actions[bot] May 12, 2025
9a71375
fix
gazarenkov May 12, 2025
9cd3091
Merge remote-tracking branch 'origin/plugin-deps' into plugin-deps
gazarenkov May 12, 2025
ba8806a
Regenerate bundle/installer manifests
github-actions[bot] May 12, 2025
757dba1
fix
gazarenkov May 12, 2025
0342234
Merge remote-tracking branch 'origin/plugin-deps' into plugin-deps
gazarenkov May 12, 2025
2c90402
Merge remote-tracking branch 'upstream/main' into plugin-deps
gazarenkov May 13, 2025
81e4534
plugin-infra-undeploy
gazarenkov May 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,14 @@ fmt: goimports ## Format the code using goimports

.PHONY: test
test: manifests generate fmt vet envtest $(LOCALBIN) ## Run tests. We need LOCALBIN=$(LOCALBIN) to get correct default-config path
mkdir -p $(LOCALBIN)/default-config && rm -fr $(LOCALBIN)/default-config/* && cp config/profile/$(PROFILE)/default-config/* $(LOCALBIN)/default-config
mkdir -p $(LOCALBIN)/default-config && rm -fr $(LOCALBIN)/default-config/* && cp -r config/profile/$(PROFILE)/default-config/* $(LOCALBIN)/default-config
mkdir -p $(LOCALBIN)/plugin-deps && rm -fr $(LOCALBIN)/plugin-deps/* && cp -r config/profile/$(PROFILE)/plugin-deps/* $(LOCALBIN)/plugin-deps 2>/dev/null || :
LOCALBIN=$(LOCALBIN) KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $(PKGS) -coverprofile cover.out

.PHONY: integration-test
integration-test: ginkgo manifests generate fmt vet envtest $(LOCALBIN) ## Run integration_tests. We need LOCALBIN=$(LOCALBIN) to get correct default-config path
mkdir -p $(LOCALBIN)/default-config && rm -fr $(LOCALBIN)/default-config/* && cp config/profile/$(PROFILE)/default-config/* $(LOCALBIN)/default-config
mkdir -p $(LOCALBIN)/default-config && rm -fr $(LOCALBIN)/default-config/* && cp -r config/profile/$(PROFILE)/default-config/* $(LOCALBIN)/default-config
mkdir -p $(LOCALBIN)/plugin-deps && rm -fr $(LOCALBIN)/plugin-deps/* && cp -r config/profile/$(PROFILE)/plugin-deps/* $(LOCALBIN)/plugin-deps 2>/dev/null || :
LOCALBIN=$(LOCALBIN) KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" $(GINKGO) -v -r $(ARGS) integration_tests

# After this time, Ginkgo will emit progress reports, so we can get visibility into long-running tests.
Expand Down Expand Up @@ -218,9 +220,8 @@ build: manifests generate fmt vet ## Build manager binary.

.PHONY: run
run: manifests generate fmt vet $(LOCALBIN) ## Run a controller from your host.
mkdir -p $(LOCALBIN)/default-config/
rm -fr $(LOCALBIN)/default-config/*
cp config/profile/$(PROFILE)/default-config/* $(LOCALBIN)/default-config/
mkdir -p $(LOCALBIN)/default-config/ && rm -fr $(LOCALBIN)/default-config/* && cp -r config/profile/$(PROFILE)/default-config/* $(LOCALBIN)/default-config/
mkdir -p $(LOCALBIN)/plugin-deps/ && rm -fr $(LOCALBIN)/plugin-deps/* && cp -r config/profile/$(PROFILE)/plugin-deps/* $(LOCALBIN)/plugin-deps/ 2>/dev/null || :
go run -C $(LOCALBIN) ../cmd/main.go

# by default images expire from quay registry after 14 days
Expand Down Expand Up @@ -363,6 +364,22 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/profile/$(PROFILE) | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -

.PHONY: plugin-infra
plugin-infra:
Comment thread
rm3l marked this conversation as resolved.
@if [ -d "config/profile/$(PROFILE)/plugin-infra" ]; then \
$(KUSTOMIZE) build config/profile/$(PROFILE)/plugin-infra | $(KUBECTL) apply -f -; \
else \
echo "Directory config/profile/$(PROFILE)/plugin-infra does not exist."; \
fi

.PHONY: plugin-infra-undeploy
plugin-infra-undeploy:
@if [ -d "config/profile/$(PROFILE)/plugin-infra" ]; then \
$(KUSTOMIZE) build config/profile/$(PROFILE)/plugin-infra | $(KUBECTL) delete -f -; \
else \
echo "Directory config/profile/$(PROFILE)/plugin-infra does not exist."; \
fi

##@ OLM Deployment

# It has to be the same namespace as ./config/default/kustomization.yaml -> namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ data:
spec:
containers:
- name: backstage-backend
image: ghcr.io/backstage/backstage:1.28.4
image: ghcr.io/backstage/backstage:1.38.1
imagePullPolicy: IfNotPresent
command:
- "node"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ metadata:
}
}
]
createdAt: "2025-04-25T07:39:51Z"
createdAt: "2025-05-12T12:54:39Z"
description: Backstage Operator
operators.operatorframework.io/builder: operator-sdk-v1.37.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
Expand Down Expand Up @@ -250,6 +250,8 @@ spec:
volumeMounts:
- mountPath: /default-config
name: default-config
- mountPath: /plugin-deps
name: plugin-deps
securityContext:
runAsNonRoot: true
serviceAccountName: backstage-controller-manager
Expand All @@ -258,6 +260,10 @@ spec:
- configMap:
name: backstage-default-config
name: default-config
- configMap:
name: plugin-deps
optional: true
name: plugin-deps
permissions:
- rules:
- apiGroups:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ metadata:
categories: Developer Tools
certified: "true"
containerImage: registry.redhat.io/rhdh/rhdh-rhel9-operator:1.7
createdAt: "2025-04-25T07:39:52Z"
createdAt: "2025-05-12T12:54:40Z"
description: Red Hat Developer Hub is a Red Hat supported version of Backstage.
It comes with pre-built plug-ins and configuration settings, supports use of
an external database, and can help streamline the process of setting up a self-managed
Expand Down Expand Up @@ -302,6 +302,8 @@ spec:
volumeMounts:
- mountPath: /default-config
name: default-config
- mountPath: /plugin-deps
name: plugin-deps
securityContext:
runAsNonRoot: true
serviceAccountName: rhdh-controller-manager
Expand All @@ -310,6 +312,10 @@ spec:
- configMap:
name: rhdh-default-config
name: default-config
- configMap:
name: rhdh-plugin-deps
optional: true
name: plugin-deps
permissions:
- rules:
- apiGroups:
Expand Down
78 changes: 62 additions & 16 deletions bundle/rhdh/manifests/rhdh-default-config_v1_configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ data:
env:
- name: NPM_CONFIG_USERCONFIG
value: /opt/app-root/src/.npmrc.dynamic-plugins
- name: MAX_ENTRY_SIZE
value: "30000000"
volumeMounts:
- mountPath: /dynamic-plugins-root
name: dynamic-plugins-root
Expand Down Expand Up @@ -348,28 +350,72 @@ data:
securityContext:
# any group id
fsGroup: 1001
dynamic-plugins.yaml: |-
dynamic-plugins.yaml: |
#apiVersion: v1
#kind: ConfigMap
#metadata:
# name: default-dynamic-plugins # must be the same as (deployment.yaml).spec.template.spec.volumes.name.dynamic-plugins-conf.configMap.name
#data:
# "dynamic-plugins.yaml": |
# ###########################################################################################################
# # /!\ WARNING
# #
# # This is the default dynamic plugins configuration file created and managed by the Operator for your CR.
# # Do NOT edit this manually in the Cluster, as your changes will be overridden by the Operator upon the
# # next reconciliation.
# # If you want to customize the dynamic plugins, you should create your own dynamic-plugins ConfigMap
# # and reference it in your CR.
# # See https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.4/html/installing_and_viewing_plugins_in_red_hat_developer_hub/rhdh-installing-rhdh-plugins_title-plugins-rhdh-about#proc-config-dynamic-plugins-rhdh-operator_rhdh-installing-rhdh-plugins
# # for more details or https://github.com/redhat-developer/rhdh-operator/blob/main/examples/rhdh-cr.yaml
# # for an example.
# ###########################################################################################################
# includes:
# - dynamic-plugins.default.yaml
# plugins: []
#---
apiVersion: v1
kind: ConfigMap
metadata:
name: default-dynamic-plugins # must be the same as (deployment.yaml).spec.template.spec.volumes.name.dynamic-plugins-conf.configMap.name
name: default-dynamic-plugins
data:
"dynamic-plugins.yaml": |
###########################################################################################################
# /!\ WARNING
#
# This is the default dynamic plugins configuration file created and managed by the Operator for your CR.
# Do NOT edit this manually in the Cluster, as your changes will be overridden by the Operator upon the
# next reconciliation.
# If you want to customize the dynamic plugins, you should create your own dynamic-plugins ConfigMap
# and reference it in your CR.
# See https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.4/html/installing_and_viewing_plugins_in_red_hat_developer_hub/rhdh-installing-rhdh-plugins_title-plugins-rhdh-about#proc-config-dynamic-plugins-rhdh-operator_rhdh-installing-rhdh-plugins
# for more details or https://github.com/redhat-developer/rhdh-operator/blob/main/examples/rhdh-cr.yaml
# for an example.
###########################################################################################################
dynamic-plugins.yaml: |
includes:
- dynamic-plugins.default.yaml
plugins: []
plugins:
- disabled: true
package: "https://github.com/rhdhorchestrator/orchestrator-plugins-internal-release/releases/download/v1.5.1/backstage-plugin-orchestrator-1.5.1.tgz"
integrity: sha512-7VOe+XGTUzrdO/av0DNHbydOjB3Lo+XdCs6fj3JVODLP7Ypd3GXHf/nssYxG5ZYC9F1t9MNeguE2bZOB6ckqTA==
pluginConfig:
dynamicPlugins:
frontend:
red-hat-developer-hub.backstage-plugin-orchestrator:
appIcons:
- importName: OrchestratorIcon
module: OrchestratorPlugin
name: orchestratorIcon
dynamicRoutes:
- importName: OrchestratorPage
menuItem:
icon: orchestratorIcon
text: Orchestrator
module: OrchestratorPlugin
path: /orchestrator
- disabled: true
package: "https://github.com/rhdhorchestrator/orchestrator-plugins-internal-release/releases/download/v1.5.1/backstage-plugin-orchestrator-backend-dynamic-1.5.1.tgz"
integrity: sha512-VIenFStdq9QvvmgmEMG8O7b2wqIebvEcqNeJ9SWZ8jen9t+efTK6D3Rde74LQ1no1QaHLx8RoxNCOuTUEF8O/g==
pluginConfig:
orchestrator:
dataIndexService:
url: http://sonataflow-platform-data-index-service
dependencies:
- ref: sonataflow
- disabled: true
package: "https://github.com/rhdhorchestrator/orchestrator-plugins-internal-release/releases/download/v1.5.1/backstage-plugin-scaffolder-backend-module-orchestrator-dynamic-1.5.1.tgz"
integrity: sha512-bnVQjVsUZ470Vgm2kd5Lo/bVa2fF0q4GufBDc/8oTQsnP3zZJQqKFvFElBTCjY76RqkECydlvZ1UFybSzvockQ==
pluginConfig:
orchestrator:
dataIndexService:
url: http://sonataflow-platform-data-index-service
route.yaml: |-
apiVersion: route.openshift.io/v1
kind: Route
Expand Down
121 changes: 121 additions & 0 deletions bundle/rhdh/manifests/rhdh-plugin-deps_v1_configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
apiVersion: v1
data:
sonataflow.yaml: |
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-knative-to-sonataflow-and-workflows # hardcoded
spec:
podSelector: {}
ingress:
- from:
- namespaceSelector:
matchLabels:
# Allow knative events to be delivered to workflows.
kubernetes.io/metadata.name: knative-eventing
- namespaceSelector:
matchLabels:
# Allow auxiliary knative function for workflow (such as m2k-save-transformation)
kubernetes.io/metadata.name: knative-serving
---
# NetworkPolicy to unblock incoming traffic to the namespace
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-external-communication # hardcoded
spec:
podSelector: {}
ingress:
- from:
- namespaceSelector:
matchLabels:
# Allow knative events to be delivered to workflows.
policy-group.network.openshift.io/ingress: ""
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-intra-network # hardcoded
spec:
# Apply this policy to all pods in the namespace
podSelector: {}
# Specify policy type as 'Ingress' to control incoming traffic rules
policyTypes:
- Ingress
ingress:
- from:
# Allow ingress from any pod within the same namespace
- podSelector: {}
---
# NetworkPolicy to allow openshift-user-workload-monitoring pods to access all pods within the workflow's namespace
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-monitoring-to-sonataflow-and-workflows # hardcoded
spec:
# Apply this policy to all pods in the namespace
podSelector: {}
# Specify policy type as 'Ingress' to control incoming traffic rules
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
# Allow openshift-user-workload-monitoring pods to access the workflow.
kubernetes.io/metadata.name: openshift-user-workload-monitoring
---
apiVersion: operator.knative.dev/v1beta1
kind: KnativeEventing
metadata:
name: knative-eventing
namespace: knative-eventing
spec:
Registry: {}
---
apiVersion: operator.knative.dev/v1beta1
kind: KnativeServing
metadata:
name: knative-serving
namespace: knative-serving
spec:
controller-custom-certs:
name: ""
type: ""
registry: {}
---
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowPlatform
metadata:
name: sonataflow-platform
spec:
monitoring:
enabled: true
services:
dataIndex:
enabled: true
persistence:
postgresql:
secretRef:
name: backstage-psql-secret-{{backstage-name}}
userKey: POSTGRES_USER
passwordKey: POSTGRES_PASSWORD
serviceRef:
name: backstage-psql-{{backstage-name}}
namespace: {{backstage-ns}}
databaseName: backstage_plugin_orchestrator
jobService:
enabled: true
persistence:
postgresql:
secretRef:
name: backstage-psql-secret-{{backstage-name}}
userKey: POSTGRES_USER
passwordKey: POSTGRES_PASSWORD
serviceRef:
name: backstage-psql-{{backstage-name}}
namespace: {{backstage-ns}}
databaseName: backstage_plugin_orchestrator
kind: ConfigMap
metadata:
name: rhdh-plugin-deps
7 changes: 7 additions & 0 deletions config/manager/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,16 @@ spec:
volumeMounts:
- mountPath: /default-config
name: default-config
- mountPath: /plugin-deps
name: plugin-deps

serviceAccountName: controller-manager
terminationGracePeriodSeconds: 10
volumes:
- name: default-config
configMap:
name: default-config
- name: plugin-deps
configMap:
name: plugin-deps
optional: true
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: backstage-backend
image: ghcr.io/backstage/backstage:1.28.4
image: ghcr.io/backstage/backstage:1.38.1
imagePullPolicy: IfNotPresent
command:
- "node"
Expand Down
6 changes: 0 additions & 6 deletions config/profile/backstage.io/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

# Adds namespace to all resources.
namespace: backstage-system

# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: backstage-

resources:
Expand Down
2 changes: 2 additions & 0 deletions config/profile/rhdh/default-config/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
env:
- name: NPM_CONFIG_USERCONFIG
value: /opt/app-root/src/.npmrc.dynamic-plugins
- name: MAX_ENTRY_SIZE
value: "30000000"
volumeMounts:
- mountPath: /dynamic-plugins-root
name: dynamic-plugins-root
Expand Down
Loading