-
Notifications
You must be signed in to change notification settings - Fork 149
full walkthrough for get started with managed resources guide #900
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
Conversation
Signed-off-by: Jared Watts <[email protected]>
✅ Deploy Preview for crossplane ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
Just chatted with @negz about removing some additional details that aren't really necessary to be quickly successful in a getting started guide 🤓 - will take a pass through to streamline now |
…ine grained details Signed-off-by: Jared Watts <[email protected]>
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 @jbw976! This looks great - only blocker is my two comments WRT not specifically talking about v2 and how it's different in these getting started guides.
|
|
||
| ## About Managed Resources in Crossplane v2 | ||
| A _managed resource_ is anything Crossplane creates and manages outside of the | ||
| Kubernetes cluster. |
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.
Should we say control plane instead of cluster?
I go back and forth. "Kubernetes cluster" is more common and likely to make more sense to most people.
On the other hand "control plane" fits more closely with our framing of what Crossplane is.
| Crossplane v2 allows you to compose namespaced resources. To better support this | ||
| new ability, managed resources (MRs) are now namespaced in Providers that have | ||
| been updated for Crossplane v2. | ||
|
|
||
| To support backwards compatibility while users are adopting Crossplane v2, each | ||
| provider will offer the legacy cluster scoped MRs in addition to the new | ||
| namespaced MRs. | ||
|
|
||
| For example, when the AWS provider that has been upated to support Crossplane v2 | ||
| is installed during this guide, you will see two CRDs for each type of managed | ||
| resource: | ||
|
|
||
| 1. A legacy cluster scoped MR in the `*.aws.upbound.io` API group | ||
| 1. A namespaced MR in the `*.aws.m.upbound.io` API group | ||
|
|
||
| {{< hint type="tip" >}} | ||
| More about namespaced managed resources can be read in the [Crossplane v2 proposal](https://github.com/crossplane/crossplane/pull/6255). | ||
| {{< /hint >}} |
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'd actually prefer to leave this detail out (in this guide at least).
Instead I'd like to completely ignore legacy topics, and just show a v2 style namespaced MR in this guide. That way folks who aren't coming from the legacy Crossplane v1 world won't need to worry about any of this.
Or another way to put it: write the v2 preview documentation as if Crossplane v1 never existed.
For folks who are coming from the legacy Crossplane v1 world I'd like to separately add a "What's new in Crossplane v2" page that explains things like this. I'm tentatively thinking we could add that under Guides, but (if possible) update the "This isn't the latest version" header to link to that guide if they're looking at a v2 page.
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.
Got it, thanks for seeing that tone to follow here, will incorporate that.
| {{< hover label="providerconfig" line="3">}}ProviderConfig{{</ hover >}} | ||
| with the this Kubernetes configuration file: | ||
| ```yaml {label="providerconfig",copy-lines="all"} | ||
| cat <<EOF | kubectl apply -f - |
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 know this is subjective but per my rant about cat <<EOF in examples yesterday I've been omitting these here docs from the getting started with composition examples.
Instead I'm just saying (e.g.) "Save this as xrd.yaml" and showing the kubectl command to apply it.
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 we should be consistent, so I'll follow what you're doing, but I have realized when running through this guide multiple times that I do actually like the single step copy/paste that heredocs enable. As opposed to copying the content, saving it to a file, then having to get a terminal to that location too, which is more steps 😇
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 made this update and when I ran through the guide to test, it definitely felt slower and more clumsy to have to save things to files and then apply them. I do prefer the zippy copy pasty heredocs! 😂
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.
Long term I'd like to go back to a variant of what we used to do:
- Add the YAML manifests as distinct files
- Embed the YAML file in the examples (to avoid duplicates)
- Provide a command that applies the file by URL - e.g.
kubectl apply -f https://docs.crossplane.io/...
This is what Kubernetes does - e.g. https://kubernetes.io/docs/tutorials/configuration/updating-configuration-via-a-configmap/#rollout-configmap-volume
I find it to be a sweet spot. If you want to just run the example in your shell you can easily copy the command. If you want to copy the YAML and edit it in vim or YAML you don't have a weird here doc getting in the way.
| ## Create a namespace | ||
| Before we can create our namespaced S3 bucket managed resource, we must create a | ||
| namespace for it. |
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 we omit this and just use the default namespace? That's what I'm doing in the Composition docs.
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.
yes that's definitely a better approach, no need to create a new namespace 🤓
| The {{< hover label="xr" line="6">}}metadata.generateName{{< /hover >}} gives a | ||
| pattern that the provider will use to create a unique name for the bucket in S3. | ||
| The generated name will look like `crossplane-bucket-<hash>`. |
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.
| The {{< hover label="xr" line="6">}}metadata.generateName{{< /hover >}} gives a | |
| pattern that the provider will use to create a unique name for the bucket in S3. | |
| The generated name will look like `crossplane-bucket-<hash>`. | |
| The {{< hover label="xr" line="6">}}metadata.generateName{{< /hover >}} gives a | |
| pattern that Kubernetes will use to create a unique name for the bucket in S3. | |
| The generated name will look like `crossplane-bucket-<hash>`. |
Nit: this is more technically accurate. That said, I don't feel strongly if it feels less confusing to pretend it's the provider doing it in this context.
|
|
||
| ## Delete the managed resource | ||
| Before shutting down your Kubernetes cluster, delete the S3 bucket just created. | ||
| Before shutting down your Kubernetes cluster, delete the S3 bucket that was just created. |
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.
| Before shutting down your Kubernetes cluster, delete the S3 bucket that was just created. | |
| Delete the S3 bucket that was just created. |
Nit: Leading with "Before shutting down your Kubernetes cluster" feels weird to me for some reason here. What if they're using an existing cluster and not e.g. kind?
I'd suggest leaving it out. Maybe we could add a {{< hint >}} mentioning that it's important to delete the bucket before uninstalling Crossplane/deleting cluster/etc.
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'll remove this language from the mainline path and include it in a <hint> box.
| Use `kubectl get buckets` to verify Crossplane created the bucket. | ||
| Use `kubectl -n crossplane-aws-app get buckets.s3.aws.m.upbound.io` to verify Crossplane created the bucket. | ||
|
|
||
| {{< hint type="tip" >}} |
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.
| {{< hint type="tip" >}} | |
| {{< hint "tip" >}} |
This is an existing issue, but I noticed these aren't actually supposed to have a type=. It just happens that when you do type="tip" it doesn't know what it should be and defaults to tip. So if you do e.g. type="note" you'll get a tip instead. 🤔
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.
ah good call out, there were 2 other "note" boxes on this page that were being displayed as tips. I'll update them all.
| Crossplane v2 allows you to compose **any type of resource** into custom APIs | ||
| for your users, which includes managed resources. Enjoy the freedom that | ||
| Crossplane v2 gives you to compose the diverse set of resources your | ||
| applications need for their unique environments, scenarios, and requirements. |
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'd drop v2 here and just say "Crossplane".
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.
thanks @negz for the feedback! I'll push a commit with everything incorporated soon :)
| Crossplane v2 allows you to compose namespaced resources. To better support this | ||
| new ability, managed resources (MRs) are now namespaced in Providers that have | ||
| been updated for Crossplane v2. | ||
|
|
||
| To support backwards compatibility while users are adopting Crossplane v2, each | ||
| provider will offer the legacy cluster scoped MRs in addition to the new | ||
| namespaced MRs. | ||
|
|
||
| For example, when the AWS provider that has been upated to support Crossplane v2 | ||
| is installed during this guide, you will see two CRDs for each type of managed | ||
| resource: | ||
|
|
||
| 1. A legacy cluster scoped MR in the `*.aws.upbound.io` API group | ||
| 1. A namespaced MR in the `*.aws.m.upbound.io` API group | ||
|
|
||
| {{< hint type="tip" >}} | ||
| More about namespaced managed resources can be read in the [Crossplane v2 proposal](https://github.com/crossplane/crossplane/pull/6255). | ||
| {{< /hint >}} |
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.
Got it, thanks for seeing that tone to follow here, will incorporate that.
| {{< hover label="providerconfig" line="3">}}ProviderConfig{{</ hover >}} | ||
| with the this Kubernetes configuration file: | ||
| ```yaml {label="providerconfig",copy-lines="all"} | ||
| cat <<EOF | kubectl apply -f - |
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 we should be consistent, so I'll follow what you're doing, but I have realized when running through this guide multiple times that I do actually like the single step copy/paste that heredocs enable. As opposed to copying the content, saving it to a file, then having to get a terminal to that location too, which is more steps 😇
| ## Create a namespace | ||
| Before we can create our namespaced S3 bucket managed resource, we must create a | ||
| namespace for it. |
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.
yes that's definitely a better approach, no need to create a new namespace 🤓
| Use `kubectl get buckets` to verify Crossplane created the bucket. | ||
| Use `kubectl -n crossplane-aws-app get buckets.s3.aws.m.upbound.io` to verify Crossplane created the bucket. | ||
|
|
||
| {{< hint type="tip" >}} |
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.
ah good call out, there were 2 other "note" boxes on this page that were being displayed as tips. I'll update them all.
|
|
||
| ## Delete the managed resource | ||
| Before shutting down your Kubernetes cluster, delete the S3 bucket just created. | ||
| Before shutting down your Kubernetes cluster, delete the S3 bucket that was just created. |
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'll remove this language from the mainline path and include it in a <hint> box.
Signed-off-by: Jared Watts <[email protected]>
| {{< /hint >}} | ||
|
|
||
| ## Composing managed resources | ||
| Crossplane allows you to compose **any type of resource** into custom APIs for |
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.
Vale hack: it thinks "type of" is too wordy but "kind of" is fine. 🙃
|
|
||
| The Crossplane {{< hover label="provider" line="3" >}}Provider{{</hover>}} | ||
| The Crossplane {{< hover label="provider" line="2" >}}Provider{{</hover>}} | ||
| installs the Kubernetes _Custom Resource Definitions_ (CRDs) representing AWS S3 | ||
| services. These CRDs allow you to create AWS resources directly inside | ||
| services. These CRDs allow you to create AWS resources directly inside | ||
| Kubernetes. |
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'd like to drop all mentions of CRDs here - too much detail for this context IMO.

This PR updates the "Get started with Managed Resources" guide to work with the v2 preview compatible AWS provider.