Skip to content

Enable plugin dependencies - #1046

Merged
openshift-merge-bot[bot] merged 46 commits into
redhat-developer:mainfrom
gazarenkov:plugin-deps
May 15, 2025
Merged

Enable plugin dependencies#1046
openshift-merge-bot[bot] merged 46 commits into
redhat-developer:mainfrom
gazarenkov:plugin-deps

Conversation

@gazarenkov

@gazarenkov gazarenkov commented Apr 16, 2025

Copy link
Copy Markdown
Member

Description

Enable plugin k8s dependencies (the k8s resources to create/merge to make plugin work) by example of Orchestrator plugin on rhdh profile.

Which issue(s) does this PR fix or relate to

https://issues.redhat.com/browse/RHIDP-6629

PR acceptance criteria

  • Tests
  • Documentation

How to test changes / Special notes to the reviewer

Note: by default Orchestrator plugin with dependencies is DISABLED on RHDH profile. To enable it:

  • make sure your OCP cluster is running and configured as current on client
  • If you want orchestrator plugin to be included in default config: set 'disabled=false' on backstage-plugin-orchestrator, backstage-plugin-orchestrator-backend-dynamic and backstage-plugin-scaffolder-backend-module-orchestrator-dynamic in /config/profiles/rhdh/operator/default-config/dynamic-plugins.yaml
  • build and push the image make image-build image-push IMG={your-image} and deploy operator with make plugin-infra deploy IMG={your-image}
    OR
  • run controller locally make install plugin-infra run
  • if you did NOT include orchestrator plugin to default config (see step 2 above), copy/paste /config/profiles/rhdh/operator/default-config/dynamic-plugins.yaml to your-dynamic-plugins.yaml, modify it the same way (enabling orchestrator plugin), rename the ConfigMap and make sure it is created and referenced in the Backstage CR's (next step) spec.application.dynamicPluginsConfigMapName field.
  • create Backstage CR in (oc apply -f {your-cr.yaml} (preferable on empty namespace for better visibility) and check the pods on its namespace, there should be no 5 pods in progress, wait until all of them are Running (it takes about 5 minutes on my cluster and several attempts for some pods). You also can check the status of your Backstage CR.
  • try to reach your RHDH instance baseUrl, it should contain Orchectrator link.

Signed-off-by: gazarenkov <gazarenkov@gmail.com>
Signed-off-by: gazarenkov <gazarenkov@gmail.com>
@gazarenkov
gazarenkov requested review from durandom, kadel and rm3l April 16, 2025 08:19
@gazarenkov gazarenkov changed the title Enable plugin dependencies [WIP]Enable plugin dependencies Apr 16, 2025
Signed-off-by: gazarenkov <gazarenkov@gmail.com>
Comment thread pkg/model/plugin_deps.go Fixed
Signed-off-by: gazarenkov <gazarenkov@gmail.com>
Signed-off-by: gazarenkov <gazarenkov@gmail.com>
Comment thread Makefile Outdated
Comment thread config/profile/rhdh/operator/default-config/dynamic-plugins.yaml Outdated
Comment thread config/profile/rhdh/operator/default-config/dynamic-plugins.yaml
Comment thread config/profile/rhdh/operator/plugin-deps/orchestrator/sample-greetings.yaml Outdated
Comment thread config/profile/rhdh/plugin-infra/orchestrator/rbac-sonataflow.yaml
Comment thread internal/controller/backstage_controller.go Outdated
Comment thread internal/controller/plugin-deps.go
@masayag

masayag commented Apr 16, 2025

Copy link
Copy Markdown

@gazarenkov does the operator run with admin rights? I'm trying to understand how the operator can create various resources on the cluster without RBAC (e.g. knative-eventing). Unless the client to apply the manifests is using cluster-admin perms.

Signed-off-by: gazarenkov <gazarenkov@gmail.com>
Signed-off-by: gazarenkov <gazarenkov@gmail.com>
@gazarenkov

Copy link
Copy Markdown
Member Author

@gazarenkov does the operator run with admin rights? I'm trying to understand how the operator can create various resources on the cluster without RBAC (e.g. knative-eventing). Unless the client to apply the manifests is using cluster-admin perms.

The part creating cluster level infrastructure (e.g. knative-eventing) is a part of operator deployment, it is performed by user (or something on behalf of user, e g olm) which has to have admin level rbac.
Creating instance level objects (e g sonataflowplatform) is performed by Backstage operator and requires rbac script for operator's ServiceAccount config/profile/rhdh/plugin-infra/orchestrator/rbac-sonataflow.yaml applied on operator deployment time along with infra.

@gazarenkov
gazarenkov requested a review from masayag April 21, 2025 13:29
Signed-off-by: gazarenkov <gazarenkov@gmail.com>
Co-authored-by: gazarenkov <gazarenkov@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Files changed in bundle and installer generation!

Those changes to the operator bundle/installer manifests should have been pushed automatically to your PR branch.

NOTE: If the PR checks are stuck after this additional commit, manually close the PR and immediately reopen it to trigger the checks again.

Co-authored-by: gazarenkov <gazarenkov@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Files changed in bundle and installer generation!

Those changes to the operator bundle/installer manifests should have been pushed automatically to your PR branch.

NOTE: If the PR checks are stuck after this additional commit, manually close the PR and immediately reopen it to trigger the checks again.

Comment on lines +65 to +82
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: {}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are cluster-wide resources. Shouldn't they be moved to plugin-infra, similar to what is done in the orchestrator-infra Helm Chart? https://github.com/redhat-developer/rhdh-chart/blob/main/charts/orchestrator-infra/templates/serverless/knatives.yaml#L28-L54
(I guess you would have the same issue with the CRDs then..)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are cluster wide but not sure they can be considered as "infra".
Can we discuss it separately, I think it can wait for next PRs ?

Comment thread Makefile
Signed-off-by: gazarenkov <gazarenkov@gmail.com>

@rm3l rm3l left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci

openshift-ci Bot commented May 15, 2025

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rm3l

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants