-
Notifications
You must be signed in to change notification settings - Fork 9
feat(workspaceobject): Add workspace object controller #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
|
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 Once the patch is verified, the new status will be reflected by the 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. |
mjudeikis
left a comment
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
I also feel it would be sad to miss this functionality in non-operator-managed kcp's. |
Summary
This PR introduces a new API,
WorkspaceObject, which enables managing any Kubernetes object within a workspace. The controller uses aRootShardreference and the workspace path to construct the appropriate kubeconfig. The API design is inspired by theObjectAPI from https://github.com/crossplane-contrib/provider-kubernetes and includes aspec.managementPoliciesfield 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):
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