Repository navigation
design: One-pager for Beta Composition Environment, a.k.a. EnvironmentConfigs - #5061
Conversation
| - Independent Managed Resource referencing: | ||
| - functions could request any Crossplane resource, so EnvironmentConfigs when it make sense to, or resources directly when it doesn’t. | ||
| - Naming Things: | ||
| - the concept of `in-memory environment` would just a convention between functions, relying on the [`apiextensions.crossplane.io/environment`](http://apiextensions.crossplane.io/environment) key in the context, as `function-patch-and-transform` already does. |
There was a problem hiding this comment.
| - the concept of `in-memory environment` would just a convention between functions, relying on the [`apiextensions.crossplane.io/environment`](http://apiextensions.crossplane.io/environment) key in the context, as `function-patch-and-transform` already does. | |
| - the concept of `in-memory environment` becomes a convention between functions, relying on the [`apiextensions.crossplane.io/environment`](http://apiextensions.crossplane.io/environment) key in the context, as `function-patch-and-transform` already does. |
There was a problem hiding this comment.
everything else above is conditional, so I'd say:
| - the concept of `in-memory environment` would just a convention between functions, relying on the [`apiextensions.crossplane.io/environment`](http://apiextensions.crossplane.io/environment) key in the context, as `function-patch-and-transform` already does. | |
| - the concept of `in-memory environment` would become just a convention between functions, relying on the [`apiextensions.crossplane.io/environment`](http://apiextensions.crossplane.io/environment) key in the context, as `function-patch-and-transform` already does. |
However I wouldn't put much focus on the form for this last part, as I want to rewrite it once the above context settles and we agree this is the way to go.
9d2dc9b to
511d873
Compare
turkenh
left a comment
There was a problem hiding this comment.
Great write up @phisco 🙌
I agree that it is very important that we are on the same page regarding what we are trying to solve before attempting to solve it 🙂 One thing that is not clear to me though, do you want to merge this without having the actual design or do you see this as a living document and plan to get it merged after adding details and once we reach to a consensus on the final design? Because I am not sure if it makes sense to aim merging it as a design doc without having the actual design 🤔
| Composition, resulting in multiple EnvironmentConfigs being created. | ||
| - D: needs to be actively supported by providers, and there is a will to drop | ||
| it one day to reduce the maintenance burden possibly; usually, they don't | ||
| cross a single provider's boundaries. |
There was a problem hiding this comment.
| cross a single provider's boundaries. | |
| cross a single provider's boundaries and could only reference to a single, compiled type. |
There was a problem hiding this comment.
what do you mean by compiled?
|
|
||
| So we would have to: | ||
|
|
||
| - Focus on https://github.com/crossplane/crossplane/issues/4739 for 1.15 |
There was a problem hiding this comment.
Just catching up with the latest state there. I need some time to process but my early thoughts are:
I am not yet convinced that the approach there should be the way we support composition environments while it might make sense for requesting extra resources. I feel like we need a more "native" support for environments rather than supporting them as a side effect (of capability of requesting extra resources) with a good amount of boilerplate code and 1-2 function calls each responsible with some part. This is mostly based on the fact that we know composition environments are crucial for any non-trivial composition and the desire to provide a smooth UX to enable this. So, my mind still goes to a solution like this instead of splitting this functionality to dedicated functions.
If I try to make an analogy:
We are designing UNIX and discussing how someone should pass some variables into commands and instead of defining/inventing the thing we know as Environment Variables in UNIX, we are talking about suggesting something like the following as a solution for those who need such a functionality:
env-requester | env-merger | cmd1 | cmd 2instead of:
export VAR1=value1
source /path/to/somefile
cmd1 | cmd2I know this is not the perfect example, so please don't list the differences between a UNIX environment and K8s/Crossplane etc 😅, the point I am trying to make is more about embracing a widely needed functionality and providing the best possible UX with native support vs "enabling" it somehow.
There was a problem hiding this comment.
As per your example, the two things don't exclude each other, in shell scripts, piped commands have access to the environment.
To continue with the UNIX analogy, I see enabling functions to retrieve resources more like providing UNIX sockets and leaving to users to decide what to do with them.
What I'm suggesting is indeed, given that we have a finite amount of time, to put on hold the development of a native approach and instead focus on enabling functions. Nothing would block us from "bringing back in" as native the "best possible UX" once it emerges from functions and we agree on it.
|
@turkenh, I do want to rewrite the final part before merging, although it might be more a "plan" rather than a "design", as if we agree on the one proposed, the actual design will be needed for #4739, through its own one-pager, which I'm already working on; while here we'll only say we'll rely on that and take note of the needs we should take into consideration while designing that. |
Signed-off-by: Philippe Scorsolini <p.scorsolini@gmail.com>
Signed-off-by: Philippe Scorsolini <p.scorsolini@gmail.com>
dbba439 to
5629ace
Compare
|
FYI, the proposal to add extra resource gathering capabilities to Functions: #5099 |
Signed-off-by: Philippe Scorsolini <p.scorsolini@gmail.com>
|
I think we reached consensus on the path forward here, see the last part of the proposal. I understand that it's a weird Design Document. It's not actually proposing a design; it's more of an issue statement/documentation and a decision log. We clearly state that we won't be actively investing further into the native "Composition Environment" and won't set any timeline for its promotion to Beta. This might never happen if the function-based approach we think could replace the in-tree implementation works (NOTE: in such a case, we would offer as smooth a transition as possible from the native approach). So, I still think it might be worth merging this just to have something to point people at when they ask when Composition Environment (a.k.a. EnvironmentConfigs) is going to be promoted to Beta or more trivial questions like "how to patch back to the EnvironmentConfig". |
|
@negz, although I do like the idea in theory, in practice, I'm not a huge fan of ADRs. In my experience, they require a lot of discipline to get right, and it feels like there is a lot of overlap with the context already available in PRs and commits. But, maybe I just never saw them used as they should be; that's totally plausible. I feel this could still be called a "one-pager" as I think it fits the definition provided by the But the name of the file is definitely not a hill I would die on, so I could go either way. |
Description of your changes
In this one-pager, I attempted to summarize the necessary context to understand the current implementation of the
Composition Environment(also known as EnvironmentConfigs) as described by the original one-pager, and to discuss issues that we saw emerging with it.Please, focus on the above first, so that we can have a shared understanding of what we are trying to solve.
In the end, I try to propose an approach to address the above issues, taking into account the overall direction Crossplane seems to be heading for, and to discuss the next steps we need before promoting this functionality to beta.
Please consider this section as a proposal, I decided to leave it there to have a starting point for discussion, but should be reviewed against any change to the context above and rewritten to be more "prescriptive" with whatever decision we take in the end.
I have:
Runmake 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.Need help with this checklist? See the cheat sheet.