Skip to content

Commit 35fa1a4

Browse files
committed
Update sidebar behavior and documentation
Signed-off-by: Rae Sharp <[email protected]>
1 parent b652a64 commit 35fa1a4

File tree

25 files changed

+669
-439
lines changed

25 files changed

+669
-439
lines changed

content/master/cli/_index.md

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4,61 +4,3 @@ title: CLI Reference
44
description: "Documentation for the Crossplane command-line interface"
55
---
66

7-
The Crossplane CLI helps simplify some development and administration aspects of
8-
Crossplane.
9-
10-
The Crossplane CLI includes:
11-
* tools to build, install, update and push Crossplane Packages
12-
* standalone Composition Function testing and rendering without the need to access a Kubernetes cluster running Crossplane
13-
* troubleshoot Crossplane Compositions, Composite Resources and Managed Resources
14-
15-
## Installing the CLI
16-
17-
The Crossplane CLI is a single standalone binary with no external dependencies.
18-
19-
{{<hint "note" >}}
20-
Install the Crossplane CLI on a user's computer.
21-
22-
Most Crossplane CLI commands are independent of Kubernetes and
23-
don't require access to a Crossplane pod.
24-
{{< /hint >}}
25-
26-
To download the latest version for your CPU architecture with the Crossplane
27-
install script.
28-
29-
```shell
30-
curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh" | sh
31-
```
32-
33-
[The script](https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh)
34-
detects your CPU architecture and downloads the latest stable release.
35-
36-
{{<expand "Manually install the Crossplane CLI" >}}
37-
38-
If you don't want to run shell script you can manually download a binary from
39-
the Crossplane releases repository at
40-
https://releases.crossplane.io/stable/current/bin
41-
42-
{{<hint "important" >}}
43-
<!-- vale write-good.Passive = NO -->
44-
The release repository names the CLI `crank`. Download this file.
45-
<!-- vale write-good.Passive = YES -->
46-
47-
The `crossplane` binary is the Kubernetes Crossplane pod image.
48-
{{< /hint >}}
49-
50-
Move the binary to a location in your `$PATH`, for example `/usr/local/bin`.
51-
{{< /expand >}}
52-
53-
### Download other CLI versions
54-
55-
Download different Crossplane CLI versions or different release branches with
56-
the `XP_CHANNEL` and `XP_VERSION` environmental variables.
57-
58-
By default the CLI installs from the `XP_CHANNEL` named `stable` and the
59-
`XP_VERSION` of `current`, matching the most recent stable release.
60-
61-
For example, to install CLI version `v1.14.0` add `XP_VERSION=v1.14.0` to the
62-
download script curl command:
63-
64-
`curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh" | XP_VERSION=v1.14.0 sh`
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
weight: 40
3+
title: CLI Installation
4+
description: "Documentation for the Crossplane command-line interface"
5+
---
6+
7+
The Crossplane CLI helps simplify some development and administration aspects of
8+
Crossplane.
9+
10+
The Crossplane CLI includes:
11+
* tools to build, install, update and push Crossplane Packages
12+
* standalone Composition Function testing and rendering without the need to access a Kubernetes cluster running Crossplane
13+
* troubleshoot Crossplane Compositions, Composite Resources and Managed Resources
14+
15+
## Installing the CLI
16+
17+
The Crossplane CLI is a single standalone binary with no external dependencies.
18+
19+
{{<hint "note" >}}
20+
Install the Crossplane CLI on a user's computer.
21+
22+
Most Crossplane CLI commands are independent of Kubernetes and
23+
don't require access to a Crossplane pod.
24+
{{< /hint >}}
25+
26+
To download the latest version for your CPU architecture with the Crossplane
27+
install script.
28+
29+
```shell
30+
curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh" | sh
31+
```
32+
33+
[The script](https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh)
34+
detects your CPU architecture and downloads the latest stable release.
35+
36+
{{<expand "Manually install the Crossplane CLI" >}}
37+
38+
If you don't want to run shell script you can manually download a binary from
39+
the Crossplane releases repository at
40+
https://releases.crossplane.io/stable/current/bin
41+
42+
{{<hint "important" >}}
43+
<!-- vale write-good.Passive = NO -->
44+
The release repository names the CLI `crank`. Download this file.
45+
<!-- vale write-good.Passive = YES -->
46+
47+
The `crossplane` binary is the Kubernetes Crossplane pod image.
48+
{{< /hint >}}
49+
50+
Move the binary to a location in your `$PATH`, for example `/usr/local/bin`.
51+
{{< /expand >}}
52+
53+
### Download other CLI versions
54+
55+
Download different Crossplane CLI versions or different release branches with
56+
the `XP_CHANNEL` and `XP_VERSION` environmental variables.
57+
58+
By default the CLI installs from the `XP_CHANNEL` named `stable` and the
59+
`XP_VERSION` of `current`, matching the most recent stable release.
60+
61+
For example, to install CLI version `v1.14.0` add `XP_VERSION=v1.14.0` to the
62+
download script curl command:
63+
64+
`curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh" | XP_VERSION=v1.14.0 sh`

content/master/composition/compositions.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,12 @@ reports `True`.
140140

141141
Crossplane calls a Function to determine what resources it should create when
142142
you create a composite resource. The Function also tells Crossplane what to do
143-
with these resources when you update or delete a composite resource.
143+
with these resources when you update a composite resource.
144+
145+
{{<hint "note" >}}
146+
Composition functions don't run when you delete a composite resource.
147+
Crossplane handles deletion of composed resources automatically.
148+
{{< /hint >}}
144149

145150
When Crossplane calls a Function it sends it the current state of the composite
146151
resource. It also sends it the current state of any resources the composite
@@ -576,7 +581,7 @@ sequenceDiagram
576581
Crossplane Pod->>+API Server: Apply desired composed resources
577582
```
578583

579-
When you create, update, or delete a composite resource that uses composition
584+
When you create or update a composite resource that uses composition
580585
functions Crossplane calls each function in the order they appear in the
581586
Composition's pipeline. Crossplane calls each function by sending it a gRPC
582587
RunFunctionRequest. The function must respond with a gRPC RunFunctionResponse.
@@ -769,3 +774,35 @@ that isn't desired state. Functions can use context for this. Any function can
769774
write to the pipeline context. Crossplane passes the context to all following
770775
functions. When Crossplane has called all functions it discards the pipeline
771776
context.
777+
778+
### Function response cache
779+
780+
{{<hint "note" >}}
781+
Function response caching is an alpha feature. Enable it by setting the
782+
`--enable-function-response-cache` feature flag.
783+
{{< /hint >}}
784+
785+
Crossplane can cache function responses to improve performance by reducing
786+
repeated function calls. When enabled, Crossplane caches responses from
787+
composition functions that include a Time-To-Live (TTL) value.
788+
789+
The cache works by:
790+
- Storing function responses on disk based on a hash of the request
791+
- Only caching responses with a non-zero TTL
792+
- Automatically removing expired cache entries
793+
- Reusing cached responses for identical requests until they expire
794+
795+
This feature is particularly useful for functions that:
796+
- Perform expensive computations or external API calls
797+
- Return stable results for the same inputs
798+
- Include appropriate TTL values in their responses
799+
800+
#### Cache configuration
801+
802+
Control the cache behavior with these Crossplane pod arguments:
803+
804+
- `--xfn-cache-max-ttl` - Maximum cache duration (default: 24 hours)
805+
806+
The cache stores files in the `/cache/xfn/` directory within the Crossplane pod.
807+
For better performance, consider using an in-memory cache by mounting an
808+
emptyDir volume with `medium: Memory`.

content/master/get-started/install.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ at the table below.
106106
| --- | --- | --- |
107107
| Beta | `--enable-deployment-runtime-configs` | Enable support for DeploymentRuntimeConfigs. |
108108
| Beta | `--enable-usages` | Enable support for Usages. |
109-
| Alpha | `--enable-realtime-compositions` | Enable support for real time compositions. |
109+
| Beta | `--enable-realtime-compositions` | Enable support for real time compositions. |
110110
| Alpha | `--enable-dependency-version-upgrades ` | Enable automatic version upgrades of dependencies when updating packages. |
111+
| Alpha | `--enable-function-response-cache` | Enable caching of composition function responses to improve performance. |
111112
| Alpha | `--enable-signature-verification` | Enable support for package signature verification via ImageConfig API. |
112113
{{< /table >}}
113114
{{< /expand >}}

content/master/guides/function-patch-and-transform.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ environment:
424424
patches:
425425
- type: ToCompositeFieldPath
426426
fromFieldPath: tags
427-
toFieldPath: metadata.labels[envTag]
427+
toFieldPath: status.envTag
428428
- type: FromCompositeFieldPath
429429
fromFieldPath: metadata.name
430430
toFieldPath: newEnvironmentKey
@@ -667,7 +667,12 @@ Composition and use it in a second composed resource in the same Composition.
667667
{{< /hint >}}
668668

669669
For example, after Crossplane creates a new managed resource, take the value
670-
`hostedZoneID` and apply it as a `label` in the composite resource.
670+
`hostedZoneID` and store it in the composite resource's status.
671+
672+
{{< hint "important" >}}
673+
To patch to composite resource status fields, you must first define the custom
674+
status fields in the CompositeResourceDefinition.
675+
{{< /hint >}}
671676

672677
```yaml {label="toComposite",copy-lines="9-11"}
673678
apiVersion: pt.fn.crossplane.io/v1beta1
@@ -683,7 +688,7 @@ resources:
683688
patches:
684689
- type: ToCompositeFieldPath
685690
fromFieldPath: status.atProvider.hostedZoneId
686-
toFieldPath: metadata.labels['ZoneID']
691+
toFieldPath: status.hostedZoneId
687692
```
688693

689694
View the created managed resource to see the
@@ -698,12 +703,14 @@ Status:
698703
# Removed for brevity
699704
```
700705

701-
Next view the composite resource and confirm the patch applied the `label`
706+
Next view the composite resource and confirm the patch applied to the status
702707

703708
```yaml {label="toCompositeXR",copy-lines="none"}
704709
$ kubectl describe composite
705710
Name: my-example-p5pxf
706-
Labels: ZoneID=Z2O1EMRO9K5GLX
711+
# Removed for brevity
712+
Status:
713+
Hosted Zone Id: Z2O1EMRO9K5GLX
707714
```
708715

709716
<!-- vale Google.Headings = NO -->

content/master/guides/pods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Kubernetes API server when a composed resource changes. For example, when
137137
a provider sets the `Ready` condition to `true`.
138138

139139
{{<hint "important" >}}
140-
Real time compositions are an alpha feature. Alpha features aren't enabled by
140+
Real time compositions are a beta feature. Beta features are enabled by
141141
default.
142142
{{< /hint >}}
143143

content/master/learn/_index.md

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,3 @@ description: Learn more about Crossplane.
44
weight: 500
55
---
66

7-
If you have any questions, please post in [Crossplane Slack][join-crossplane-slack] or [contact the team][contact-us].
8-
9-
***Learn more about using Crossplane***
10-
- [Latest Design Docs](https://github.com/crossplane/crossplane/tree/main/design)
11-
- [Roadmap](https://github.com/crossplane/crossplane/blob/main/ROADMAP.md)
12-
- [Crossplane Architecture](https://docs.google.com/document/d/1whncqdUeU2cATGEJhHvzXWC9xdK29Er45NJeoemxebo/edit?usp=sharing)
13-
- [GitLab deploys into multiple clouds from kubectl using Crossplane](https://about.gitlab.com/2019/05/20/gitlab-first-deployed-kubernetes-api-to-multiple-clouds/)
14-
- [CNCF Talks & Community Presentations](https://www.youtube.com/playlist?list=PL510POnNVaaZJj9OG6PbgsZvgYbhwJRyE)
15-
<!-- vale write-good.Weasel = NO -->
16-
- [Software Engineering Daily - Intro Podcast](https://softwareengineeringdaily.com/2019/01/02/crossplane-multicloud-control-plane-with-bassam-tabbara/)
17-
<!-- vale write-good.Weasel = YES -->
18-
19-
***Writing Kubernetes controllers to extend Crossplane***
20-
- [Keep the Space Shuttle Flying: Writing Robust Operators](https://www.youtube.com/watch?v=uf97lOApOv8)
21-
- [Best practices for building Kubernetes Operators](https://cloud.google.com/blog/products/containers-kubernetes/best-practices-for-building-kubernetes-operators-and-stateful-apps)
22-
- [Programming Kubernetes Book](https://www.oreilly.com/library/view/programming-kubernetes/9781492047094/)
23-
- [Contributor Guide](https://github.com/crossplane/crossplane/blob/main/CONTRIBUTING.md)
24-
25-
***Join the growing Crossplane community and get involved***
26-
- Join the [Community Slack](https://slack.crossplane.io/)!
27-
- Submit an issue on [GitHub](https://github.com/crossplane/crossplane)
28-
- Attend the biweekly [Community Meeting](https://github.com/crossplane/crossplane#get-involved)
29-
- Join the biweekly live stream: [The Binding Status](https://github.com/crossplane/tbs)
30-
- Subscribe to the [YouTube Channel](https://www.youtube.com/channel/UC19FgzMBMqBro361HbE46Fw)
31-
<!-- vale Crossplane.Spelling = NO -->
32-
- Follow on Twitter: [@crossplane_io](https://twitter.com/crossplane_io)
33-
<!-- vale gitlab.SubstitutionWarning = NO -->
34-
35-
<!-- vale gitlab.SubstitutionWarning = YES -->
36-
<!-- vale Crossplane.Spelling = YES -->
37-
38-
<!-- Named links -->
39-
40-
[join-crossplane-slack]: https://slack.crossplane.io
41-
[contact-us]: https://github.com/crossplane/crossplane#contact
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Additional Resources
3+
description: Learn more about Crossplane.
4+
weight: 200
5+
---
6+
7+
If you have any questions, please post in [Crossplane Slack][join-crossplane-slack] or [contact the team][contact-us].
8+
9+
***Learn more about using Crossplane***
10+
- [Latest Design Docs](https://github.com/crossplane/crossplane/tree/main/design)
11+
- [Roadmap](https://github.com/crossplane/crossplane/blob/main/ROADMAP.md)
12+
- [Crossplane Architecture](https://docs.google.com/document/d/1whncqdUeU2cATGEJhHvzXWC9xdK29Er45NJeoemxebo/edit?usp=sharing)
13+
- [GitLab deploys into multiple clouds from kubectl using Crossplane](https://about.gitlab.com/2019/05/20/gitlab-first-deployed-kubernetes-api-to-multiple-clouds/)
14+
- [CNCF Talks & Community Presentations](https://www.youtube.com/playlist?list=PL510POnNVaaZJj9OG6PbgsZvgYbhwJRyE)
15+
<!-- vale write-good.Weasel = NO -->
16+
- [Software Engineering Daily - Intro Podcast](https://softwareengineeringdaily.com/2019/01/02/crossplane-multicloud-control-plane-with-bassam-tabbara/)
17+
<!-- vale write-good.Weasel = YES -->
18+
19+
***Writing Kubernetes controllers to extend Crossplane***
20+
- [Keep the Space Shuttle Flying: Writing Robust Operators](https://www.youtube.com/watch?v=uf97lOApOv8)
21+
- [Best practices for building Kubernetes Operators](https://cloud.google.com/blog/products/containers-kubernetes/best-practices-for-building-kubernetes-operators-and-stateful-apps)
22+
- [Programming Kubernetes Book](https://www.oreilly.com/library/view/programming-kubernetes/9781492047094/)
23+
- [Contributor Guide](https://github.com/crossplane/crossplane/blob/main/CONTRIBUTING.md)
24+
25+
***Join the growing Crossplane community and get involved***
26+
- Join the [Community Slack](https://slack.crossplane.io/)!
27+
- Submit an issue on [GitHub](https://github.com/crossplane/crossplane)
28+
- Attend the biweekly [Community Meeting](https://github.com/crossplane/crossplane#get-involved)
29+
- Join the biweekly live stream: [The Binding Status](https://github.com/crossplane/tbs)
30+
- Subscribe to the [YouTube Channel](https://www.youtube.com/channel/UC19FgzMBMqBro361HbE46Fw)
31+
<!-- vale Crossplane.Spelling = NO -->
32+
- Follow on Twitter: [@crossplane_io](https://twitter.com/crossplane_io)
33+
<!-- vale gitlab.SubstitutionWarning = NO -->
34+
35+
<!-- vale gitlab.SubstitutionWarning = YES -->
36+
<!-- vale Crossplane.Spelling = YES -->
37+
38+
<!-- Named links -->
39+
40+
[join-crossplane-slack]: https://slack.crossplane.io
41+
[contact-us]: https://github.com/crossplane/crossplane#contact

content/master/operations/operation.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,31 @@ For more details on RBAC configuration, see the
297297
[Compositions RBAC documentation]({{<ref "../composition/compositions#grant-access-to-composed-resources">}}).
298298
{{</hint>}}
299299

300+
### Function response cache
301+
302+
{{<hint "note" >}}
303+
Function response caching is an alpha feature. Enable it by setting the
304+
`--enable-function-response-cache` feature flag.
305+
{{< /hint >}}
306+
307+
Operations can benefit from function response caching to improve performance,
308+
especially for operations that:
309+
- Call the same functions repeatedly with identical inputs
310+
- Use functions that perform expensive computations or external API calls
311+
- Run frequently through CronOperation or WatchOperation
312+
313+
The cache works the same way as for Compositions - function responses with
314+
time to live values are cached and reused for identical requests until
315+
they expire.
316+
317+
This is particularly useful for Operations that:
318+
- Validate configurations using expensive checks
319+
- Query external systems for status information
320+
- Perform complex calculations that don't change frequently
321+
322+
For cache configuration details, see the
323+
[Function response cache documentation]({{<ref "../composition/compositions#function-response-cache">}}).
324+
300325
### Required resources
301326

302327
Operations can preload resources for functions to access:

0 commit comments

Comments
 (0)