-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Proposal: Crossplane v2 #6255
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
Proposal: Crossplane v2 #6255
Conversation
| `<service>.<provider>.m.crossplane.io`. For example | ||
| `compute.gcp.m.crossplane.io`. The `m` is short for “managed”. | ||
|
|
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.
I'm open to other ideas here.
What I'd like to avoid is using v2 or namespaced in the API group.
I'd like to avoid v2 because it creates confusing API versions: e.g. ec2.aws.v2.crossplane.io/v1beta2. Is it v2 or v1beta2 or both? What happens if someday we want to introduce Crossplane v3? Would we be in a position where we need to change the API group again, even if we didn't want to change anything about MRs?
I'd like to avoid namespaced because long term I expect all MRs will be namespaced.
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.
If the eventual goal is to dispose of cluster scoped MRs in some future version of crossplane (v3+?) then would not any change to the API group in V2 become redundant?
Could this instead be solved by the introduction of an optional field say targetNamespace similar to how helm deployments are managed in fluxcd or destination.namespace from argocd? It's a pattern that users are likely already familiar with and would potentially reduce cognitive load.
Whilst this may result in a potentially breaking change across v2 -> some other future version the impact would likely be far smaller than changing the API group. I would also consider it less confusing to the end user who would have to know the difference between <service>.<provider>.upbound.io and <service>.<provider>.m.crossplane.io
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.
I do not like the m for "managed"; it doesn’t encapsulate the difference between cluster-scoped MRs and namespaced. Maybe having ns wildly used in the community would convey better that we are dealing with namespaced MRs
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.
If the eventual goal is to dispose of cluster scoped MRs in some future version of crossplane (v3+?) then would not any change to the API group in V2 become redundant?
I think this needs to be explicitly called out as a non-goal. I'm not convinced (yet?) that all of the current use-cases running in v1 are supported by v2. Until they are, or migration paths to equivalent functionality are identified, future deprecations should not be considered as likely.
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.
What I'd like to avoid is using
v2ornamespaced[or variants thereof] in the API group.
I don't think anyone loves m for managed but at this point no one has made a better suggestion that complies with the above constraints, so it's what we're likely to run with.
If the eventual goal is to dispose of cluster scoped MRs in some future version of crossplane (v3+?) then would not any change to the API group in V2 become redundant?
@mproffitt I don't follow most of your comment, sorry.
To make sure we're on the same page:
- We need to support cluster scoped and namespaced variants of the same MR, at least for a transition period.
- In many control planes these variants will both exist at the same time. e.g. You might have legacy, cluster scoped RDS
InstanceMRs running alongside namespacedInstanceMRs. - For this to be possible, the new namespaced MRs need to either have a different kind (e.g.
Instance) or a different API group (e.g.rds.aws.crossplane.io) group.
The kind and API group is a top-level CRD field - it can't change from version to version of the CR. So is scope. This means to have cluster scoped and namespaced variants we need two CRDs, and therefore their kind or API group must differ.
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.
I think this needs to be explicitly called out as a non-goal. I'm not convinced (yet?) that all of the current use-cases running in v1 are supported by v2. Until they are, or migration paths to equivalent functionality are identified, future deprecations should not be considered as likely.
@bobh66 Can you refresh my memory on those use cases (or link them if they're in another thread)?
At this point the intention is to drop cluster scoped MRs after some (long) transition period. I feel it's needlessly complicated to keep both forever.
Currently we create namespaces for our users and give them access to all APIs under their namespace (a K8s role allowing everything). And then create claims for APIs we think our users should be able to call directly, like creating an ec2 instance, but not for more foundational infra, like creating a VPC or security groups. |
|
|
||
| I propose we make the following changes in Crossplane v2. | ||
|
|
||
| In core I propose we: |
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.
Do we believe that in V1 we should natively support asynchronous reconciliation of resources or do we feel that is more of a V2 feature?
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.
Can you clarify what you mean by async reconciliation of resources? It's not something on my radar.
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.
I think this is probably what @blakeromano was referring to:
That's not currently in scope for the initial v2 effort, but it could be considered for future releases.
bobh66
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.
Overall I'm supportive but I do feel like there are unknown impacts of removing claims and namespacing things, and I'm very concerned about the foreground deletion handling. Breaking that is a showstopper for us. I'm also a little concerned that the "legacy" modes would become second-class citizens even though they are foundational to much of how Crossplane has been evolving and how it is used by current adopters. A phased implementation will be important to ensure continuity and identify unforeseen issues.
| Upjet providers can skip step 2, as there are no unique `ExternalClient` | ||
| implementations to duplicate. | ||
|
|
||
| A namespaced variant of the embedded `xpv1.ResourceSpec` struct is required to |
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.
What is the impact of this change on RBAC management for the providers? Assuming the RBAC manager continues to handle RBAC by default, are there any issues with Providers (and Crossplane) now needing access to (potentially) all namespaces? Given that everything is cluster-scoped now maybe the difference is irrelevant, but I think the impact needs to be documented.
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.
Today when you install a provider the RBAC manager grants Crossplane (and the crossplane-admin role etc) access to all the MRs it defines - that'd still be true under this proposal. It'd just be granting that to all namespaces.
Do you feel this proposal needs to record that specifically?
|
|
||
| Controlling the entire stack allows Crossplane to serve its user base better. | ||
| Consider management policies, which allows any Crossplane MR to be put into an | ||
| observe-only mode (among other things). It’s controlling the MR layer that |
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.
How would crossplane manage observe-only resources for in-cluster MRs in this manner and how would that differ from the behaviour of say function-extra-resources Would an in-cluster O-O MR be able to observe across namespace or would you imagine this being entirely restricted to its own namespace
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.
Sorry, I'm not following the question.
What do you mean by "in-cluster MRs"? A provider-kubernetes Object that observes a resource in the same cluster?
clementblaise
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.
Thanks for putting the proposal together. While I see many advantages to having Namespaced MR and Composites, I agree with others that losing the ability to choose foreground deletion would be a deal breaker.
|
Thanks, @negz, for writing that proposal. Our main use case of Crossplane is to enable users to order managed services in self-service, in the form of "classic" databases, but also SaaS applications like Keycloak or Forgejo. We basically act like we're a Hyperscaler, offering managed services via API. But instead of pinging a remote API to get a service, we're "the remote API". You wrote it very well: "You can use Crossplane to manage applications, but it’s awkward" and that's very true for us. Having said that, I fully support the proposal, and it makes me happy to see Crossplane moving in this direction. |
|
Should extra resources support namespace resourced with v2? |
|
Okay, I took a pass through all the comment threads and replied to everyone. I've biased for resolving threads, but don't take that as me shutting down conversations. Feel free to respond if there's things you feel strongly about. Next step is to push a few commits with updates to the design itself. At this stage I don't think the design will be an exhaustive list of the changes we'll make in v2. Instead it'll establish the overarching direction. For a more fine-grained list of things we're doing or considering doing you can:
|
This commit adds the first draft of a proposal for Crossplane v2. Signed-off-by: Nic Cope <[email protected]>
Signed-off-by: Nic Cope <[email protected]>
Signed-off-by: Nic Cope <[email protected]>
Signed-off-by: Nic Cope <[email protected]>
Signed-off-by: Nic Cope <[email protected]>
Signed-off-by: Nic Cope <[email protected]>
Signed-off-by: Nic Cope <[email protected]>
Signed-off-by: Nic Cope <[email protected]>
Signed-off-by: Nic Cope <[email protected]>
|
@crossplane/steering-committee - I believe this proposal is ready for your final review. I'd like approval from the steering committee because this proposal affects the whole ecosystem, not just this core repo. @crossplane/crossplane-maintainers That said, I'd appreciate your final review as well. |
jbw976
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.
I've been pumped for v2 for a long time now and after playing with it, developing for it, etc. I am even more excited. Great work on this @negz, let's goooo! 💪
| an allow list of the types and namespaces that may reference a particular kind | ||
| of resource. | ||
|
|
||
| I believe it would be possible to introduce a ReferenceGrant-like API at a later |
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.
do you think that we should wait until we have a ReferenceGrant-like API before we enable/allow cross namespaced references on MRs?
If we want to have cross namespace references before then, i.e. with the release of v2, we'll need go further than what I've already done to introduce reference resolving to namespaced MRs in the following PRs:
- feat: enable namespaced reference resolution crossplane-runtime#843
- feat: enable namespaced references in generated resolvers crossplane-tools#110
- feat: support namespaced reference resolving crossplane-contrib/provider-upjet-aws#1799
That implementation does not have a namespace field for references, it assumes that a reference on a namespaced resource will be within the same namespace. So if we want to wait until we have some ReferenceGrant capability, then we are all good for now 😇
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.
I feel like it might be a hard sell to not support this at launch. We're already seeing some push back about not being able to compose into other namespaces, let alone reference them. So I suspect not supporting references across namespaces might have a chilling effect on the uptake of namespaced MRs.
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.
It seems like the ReferenceGrant API referenced in the gatewayapi docs seems highly generic. Apart from the fact that its in the gateway.networking.k8s.io/v1beta1, the functionality seems universally applicable. I also maintain a controller for composing ConfigMaps and Secrets that utilizes cross-namespace references, but supports an annotation-based convention for "allowing" a resource of that controller in another namespace to reference a resource. If ReferenceGrants were a generalized, standard API in Kubernetes, I would probably leverage that instead.
Aaaand, of of course, there's a SIG for that :) https://github.com/kubernetes-sigs/referencegrant-poc/
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.
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.
I've been working/tinkering with some of the referencegrant things (kubernetes/enhancements#4387). We ended up not pushing it forward for now, but working on the prerequisites/more foundational concepts such as conditional and referential authorization instead.
ReferenceGrant is a non-trivial thing to get right securely, however, so I'd be interested in the more concrete use-cases for this. Is a decent compromise to allow either of the following?
a) Only allow referring to an MR across namespaces, if you already have access to get/update/"use" the referenced resource as per k8s RBAC (this can be enforced by a ValidatingAdmissionPolicy)
b) Allow referring from a namespaced MR to a cluster-scoped MR, potentially also requiring the same referential authorization check.
Description of your changes
This PR adds the first draft of a proposal for Crossplane v2.
The PR proposes a new version of Crossplane that’s simpler and better suited to managing applications, not just the infrastructure they depend on.
In Crossplane v2:
Under this proposal Crossplane v2 would be backward compatible with Crossplane v1. Most Crossplane users could upgrade to Crossplane v2 without any breaking changes.
Existing v1 style cluster scoped XRs with claims and cluster scoped MRs would continue to work in Crossplane v2. These would be considered legacy features and wouldn’t appear in Crossplane’s main documentation flows for new users. Existing users could adopt v2 style XRs and MRs at their leisure.
I have:
Runearthly +reviewableto ensure this PR is ready for review.Added or updated unit tests.Added or updated e2e tests.Linked a PR or a docs tracking issue to document this change.Addedbackport release-x.ylabels to auto-backport this PR.Followed the API promotion workflow if this PR introduces, removes, or promotes an API.Need help with this checklist? See the cheat sheet.