Skip to content

Conversation

@MisterMX
Copy link

Summary

This PR introduces a new API, WorkspaceObject, which enables managing any Kubernetes object within a workspace. The controller uses a RootShard reference and the workspace path to construct the appropriate kubeconfig. The API design is inspired by the Object API from https://github.com/crossplane-contrib/provider-kubernetes and includes a spec.managementPolicies field to control which operations (create, update, delete) the controller should perform.

The goal of this PR is to address #122. Instead of supporting only a single kind, we adopt a broader, more generic approach that supports any object type, including Workspace, WorkspaceType, and RBAC configurations.

This work aims to provide the following capabilities, enabling us to fully manage a KCP instance without relying on third-party operators that add additional complexity (e.g., Crossplane):

  • Manage workspaces and workspace types from the host cluster
  • Manage RBAC roles and bindings from the host cluster

At present, the controller does not correctly handle system workspaces, which are shard-local. This may be improved in a future PR to allow administrators to define RBAC configurations in system workspaces for consistent, cluster-wide defaults (e.g., cluster-admin access via OIDC) without needing to apply them per workspace.

on-behalf-of: @eon-se [email protected]

What Type of PR Is This?

/kind feature

Related Issue(s)

Fixes #122

Relates to #91 by providing a way to configure RBAC roles that can be used by generated kubeconfigs.

Release Notes

Add WorkspaceObject API to allow managing any arbitrary object in a workspace.

Add a new API WorkspaceObject that allows managing (create, apply,
delete) any kind of object in a workspace.

on-behalf-of: @eon-se [email protected]
Signed-off-by: Maximilian Blatt <[email protected]>
@kcp-ci-bot kcp-ci-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: yes Indicates the PR's author has signed the DCO. labels Nov 24, 2025
@kcp-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Kubernetes Code Review Process.

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

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

@kcp-ci-bot kcp-ci-bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 24, 2025
@kcp-ci-bot
Copy link
Contributor

Hi @MisterMX. Thanks for your PR.

I'm waiting for a kcp-dev member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kcp-ci-bot kcp-ci-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Nov 24, 2025
Copy link
Contributor

@mjudeikis mjudeikis left a comment

Choose a reason for hiding this comment

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

Im still not sure if this is the right place for this change.

One of the things we are thinking about is to enable operators to support "remote shards". In this flow, it would generate a bundle of resources to be applied to remote shards.

In this scenario, a configuration like this would quickly become out of date. For example, if one updates these assets in the "management/root cluster" (we don't have a name for it yet), and the bundle is delayed in distribution, this might create some funky situations where things aren't as intended.

Or that this part of the code will not have access to remote shards.

Somehow feels that this could be an external contrib operator/plugin/addon so users can deploy it outside kcp, point to frontproxy and lifecycle resources this way.

Otherwise, this could create an expectation that these will always be updated, where in the situation with bundles, this does not quite stand to be true.

Would you be open to joining a community meeting and talking this Thursday?

)

// WorkspaceObjectSpec defines the desired state of WorkspaceObject
type WorkspaceObjectSpec struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Im bit confused about this api.
RootShard is a reference to the root shard that holds the workspace in which the manifest should be applied. - what if workspace lives on other shard, than root? Will this stop working?

feels like ^ its is not needed. Or should be renamed

WorkspaceConfig is bit strange too. Is the Path canonical or logicacluster name?

Copy link
Author

@MisterMX MisterMX Dec 2, 2025

Choose a reason for hiding this comment

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

RootShard was just the easiest way for me to allow "referencing a server". I'm open to change it to something else if there's a better alternative. The main idea motivation for this PR was user simplicity: Reference the root shard, give workspace name and manifest and let the controller do everything for you from fiddling out which shard to use (maybe all, for system namespaces and the like?).

The motivation for this PR is less about having a way to apply an object to a workspace and more about making it easy to do that. Given a predefined kubeconfig https://github.com/crossplane-contrib/provider-kubernetes does the apply just fine. But getting the kubeconfig for a specific workspace (or multiple for system workspaces) is the hard and messy part.

@xrstf
Copy link
Contributor

xrstf commented Dec 1, 2025

I also feel it would be sad to miss this functionality in non-operator-managed kcp's.

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

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. kind/feature Categorizes issue or PR as related to a new feature. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Manage workspaces

4 participants