Load example manifests and embed them inline
Our docs have plenty of example manifests that users should apply. Especially the getting started guides. We've used a few approaches to this over the years and have rarely been consistent:
- Plain YAML, with instructions saying to save it to a file and apply it
- YAML wrapped in a
kubectl applycommand with a bash HERE/EOF doc - Plain YAML, with duplicated plain YAML in a manifests dir that you can
kubectl apply -f https://do...
These all have downsides. The first makes copying less convenient for the user. The second makes the YAML manifest look uglier - wrapped in somewhat arcane shell syntax. The third means maintaining duplicate manifests.
Last time we brainstormed this with @tr0njavolta they had a good suggestion, which is a variant of 3:
- Manifests defined only in a file in the docs repo, under e.g.
content/manifests/ - Use Hugo to embed manifests inline in the docs
- Show
kubectl apply -f https://docs.crossplane.io/v2.0/manifests/...style examples
I believe this is what the Kubernetes docs do. I'd like us to adopt this approach.
Yes, this would be a nice UX improvement for folks following the guides in the docs. I'm going to transfer this to the docs repo.
edit: this is already in the docs repo, leaving my shame here for public visibility 😇