Skip to content

Commit ed05498

Browse files
committed
Add a stub page on function packages
Signed-off-by: Nic Cope <[email protected]>
1 parent e4e8457 commit ed05498

File tree

2 files changed

+82
-4
lines changed

2 files changed

+82
-4
lines changed

content/v2.0-preview/packages/configurations.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,18 @@ A _Configuration_ package is an
1010
[Compositions]({{<ref "../composition/compositions" >}}),
1111
[Composite Resource Definitions]({{<ref "../composition/composite-resource-definitions" >}})
1212
and any required [Providers]({{<ref "./providers">}}) or
13-
[Functions]({{<ref "../composition/compositions" >}}).
13+
[Functions]({{<ref "./functions" >}}).
1414

1515
Configuration packages make your Crossplane configuration fully portable.
1616

1717
{{<hint "important" >}}
18-
Crossplane [Providers]({{<ref "./providers">}}) and
19-
[Functions]({{<ref "../composition/compositions">}}) are also Crossplane packages.
18+
Crossplane Providers and Functions are also Crossplane packages.
2019

2120
This document describes how to install and manage configuration packages.
2221

2322
Refer to the
2423
[Provider]({{<ref "./providers">}}) and
25-
[Composition Functions]({{<ref "../composition/compositions">}}) chapters for
24+
[Functions]({{<ref "./functions">}}) chapters for
2625
details on their usage of packages.
2726
{{< /hint >}}
2827

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: Functions
3+
weight: 100
4+
description: "Functions extend Crossplane with new ways to configure composition"
5+
---
6+
7+
Functions extend Crossplane with new ways to configure
8+
[composition]({{<ref "../composition">}}).
9+
10+
You can use different _composition functions_ to configure what Crossplane does
11+
when someone creates or updates a
12+
[composite resource (XR)]({{<ref "../composition/composite-resources">}}).
13+
14+
{{<hint "important">}}
15+
This page is a work in progress.
16+
17+
Functions are packages, like [Providers]({{<ref "./providers">}}) and
18+
[Configurations]({{<ref "./configurations">}}). Their APIs are similar. You
19+
install and configure them the same way as a provider.
20+
21+
Read the [composition]({{<ref "../composition/compositions">}}) documentation to
22+
learn how to use functions in a composition.
23+
{{</hint>}}
24+
25+
## Install a Function
26+
27+
Install a Function with a Crossplane
28+
{{<hover label="install" line="2">}}Function{{</hover >}} object setting the
29+
{{<hover label="install" line="6">}}spec.package{{</hover >}} value to the
30+
location of the function package.
31+
32+
{{< hint "important" >}}
33+
Beginning with Crossplane version 1.20.0 Crossplane uses the [crossplane-contrib](https://github.com/orgs/crossplane-contrib/packages) GitHub Container Registry at `xpkg.crossplane.io` by default for downloading and
34+
installing packages.
35+
36+
Specify the full domain name with the `package` or change the default Crossplane
37+
registry with the `--registry` flag on the [Crossplane pod]({{<ref "../guides/pods">}})
38+
{{< /hint >}}
39+
40+
For example, to install the
41+
[patch and transform function](https://github.com/crossplane-contrib/function-patch-and-transform),
42+
43+
```yaml {label="install"}
44+
apiVersion: pkg.crossplane.io/v1
45+
kind: Function
46+
metadata:
47+
name: crossplane-contrib-function-patch-and-transform
48+
spec:
49+
package: xpkg.crossplane.io/crossplane-contrib/function-patch-and-transform:v0.8.2
50+
```
51+
52+
By default, the Function pod installs in the same namespace as Crossplane
53+
(`crossplane-system`).
54+
55+
{{<hint "note" >}}
56+
Functions are part of the
57+
{{<hover label="install" line="1">}}pkg.crossplane.io{{</hover>}} group.
58+
59+
The {{<hover label="meta-pkg" line="1">}}meta.pkg.crossplane.io{{</hover>}}
60+
group is for creating Function packages.
61+
62+
Instructions on building Functions are outside of the scope of this
63+
document.
64+
Read the Crossplane contributing
65+
[Function Development Guide](https://github.com/crossplane/crossplane/blob/main/contributing/guide-provider-development.md)
66+
for more information.
67+
68+
For information on the specification of Function packages read the
69+
[Crossplane Function Package specification](https://github.com/crossplane/crossplane/blob/main/contributing/specifications/xpkg.md#provider-package-requirements).
70+
71+
```yaml {label="meta-pkg"}
72+
apiVersion: meta.pkg.crossplane.io/v1
73+
kind: Function
74+
metadata:
75+
name: provider-aws
76+
spec:
77+
# Removed for brevity
78+
```
79+
{{</hint >}}

0 commit comments

Comments
 (0)