mirror of https://github.com/crossplane/docs.git
Merge pull request #959 from negz/plus-one
Update content/master to use v2 stable instead of preview
This commit is contained in:
commit
ad7f75a96d
|
|
@ -27,7 +27,7 @@ To download the latest version for your CPU architecture with the Crossplane
|
||||||
install script.
|
install script.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh" | XP_CHANNEL=preview sh
|
curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh" | sh
|
||||||
```
|
```
|
||||||
|
|
||||||
[The script](https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh)
|
[The script](https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ weight: 20
|
||||||
description: "Composite Resource Definitions or XRDs define custom API schemas"
|
description: "Composite Resource Definitions or XRDs define custom API schemas"
|
||||||
---
|
---
|
||||||
|
|
||||||
Composite resource definitions (`XRDs`) define the schema for a custom API.
|
Composite resource definitions (`XRDs`) define the schema for a custom API.
|
||||||
Users create composite resources (`XRs`) using the API schema defined by an
|
Users create composite resources (`XRs`) using the API schema defined by an
|
||||||
XRD.
|
XRD.
|
||||||
|
|
||||||
|
|
@ -20,15 +20,15 @@ A [composite resource]({{<ref "./composite-resources">}}) or XR is a custom API.
|
||||||
|
|
||||||
You use two Crossplane types to create a new custom API:
|
You use two Crossplane types to create a new custom API:
|
||||||
|
|
||||||
* A Composite Resource Definition (XRD) - This page. Defines the XR's schema.
|
* A Composite Resource Definition (XRD) - This page. Defines the XR's schema.
|
||||||
* A [Composition]({{<ref "./compositions" >}}) - Configures how the XR creates
|
* A [Composition]({{<ref "./compositions" >}}) - Configures how the XR creates
|
||||||
other resources.
|
other resources.
|
||||||
{{</expand >}}
|
{{</expand >}}
|
||||||
|
|
||||||
Crossplane XRDs are like
|
Crossplane XRDs are like
|
||||||
[Kubernetes custom resource definitions](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/).
|
[Kubernetes custom resource definitions](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/).
|
||||||
XRDs require fewer fields and add options related to Crossplane, like connection
|
XRDs require fewer fields and add options related to Crossplane, like connection
|
||||||
secrets.
|
secrets.
|
||||||
|
|
||||||
<!-- vale Google.Headings = NO -->
|
<!-- vale Google.Headings = NO -->
|
||||||
<!-- vale Microsoft.Headings = NO -->
|
<!-- vale Microsoft.Headings = NO -->
|
||||||
|
|
@ -40,24 +40,26 @@ Creating a CompositeResourceDefinition consists of:
|
||||||
* [Defining a custom API group](#xrd-groups).
|
* [Defining a custom API group](#xrd-groups).
|
||||||
* [Defining a custom API name](#xrd-names).
|
* [Defining a custom API name](#xrd-names).
|
||||||
* [Defining a custom API schema and version](#xrd-versions).
|
* [Defining a custom API schema and version](#xrd-versions).
|
||||||
|
* [Setting the scope](#xrd-scope) (namespaced or cluster-scoped).
|
||||||
|
|
||||||
Optionally, CompositeResourceDefinitions also support:
|
Optionally, CompositeResourceDefinitions also support:
|
||||||
* [Setting composite resource defaults](#set-composite-resource-defaults).
|
* [Setting composite resource defaults](#set-composite-resource-defaults).
|
||||||
|
|
||||||
Composite resource definitions (`XRDs`) create new API endpoints inside a
|
|
||||||
Kubernetes cluster.
|
|
||||||
|
|
||||||
Creating a new API requires defining an API
|
Composite resource definitions (`XRDs`) create new API endpoints inside a
|
||||||
{{<hover label="xrd1" line="6">}}group{{</hover>}},
|
Kubernetes cluster.
|
||||||
{{<hover label="xrd1" line="7">}}name{{</hover>}} and
|
|
||||||
{{<hover label="xrd1" line="10">}}version{{</hover>}}.
|
Creating a new API requires defining an API
|
||||||
|
{{<hover label="xrd1" line="7">}}group{{</hover>}},
|
||||||
|
{{<hover label="xrd1" line="8">}}name{{</hover>}} and
|
||||||
|
{{<hover label="xrd1" line="11">}}version{{</hover>}}.
|
||||||
|
|
||||||
```yaml {label="xrd1",copy-lines="none"}
|
```yaml {label="xrd1",copy-lines="none"}
|
||||||
apiVersion: apiextensions.crossplane.io/v1
|
apiVersion: apiextensions.crossplane.io/v2
|
||||||
kind: CompositeResourceDefinition
|
kind: CompositeResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: mydatabases.example.org
|
name: mydatabases.example.org
|
||||||
spec:
|
spec:
|
||||||
|
scope: Namespaced
|
||||||
group: example.org
|
group: example.org
|
||||||
names:
|
names:
|
||||||
kind: XMyDatabase
|
kind: XMyDatabase
|
||||||
|
|
@ -70,10 +72,10 @@ spec:
|
||||||
After applying an XRD, Crossplane creates a new Kubernetes custom resource
|
After applying an XRD, Crossplane creates a new Kubernetes custom resource
|
||||||
definition matching the defined API.
|
definition matching the defined API.
|
||||||
|
|
||||||
For example, the XRD
|
For example, the XRD
|
||||||
{{<hover label="xrd1" line="4">}}mydatabases.example.org{{</hover >}}
|
{{<hover label="xrd1" line="4">}}mydatabases.example.org{{</hover >}}
|
||||||
creates a custom resource definition
|
creates a custom resource definition
|
||||||
{{<hover label="kubeapi" line="2">}}mydatabases.example.org{{</hover >}}.
|
{{<hover label="kubeapi" line="2">}}mydatabases.example.org{{</hover >}}.
|
||||||
|
|
||||||
```shell {label="kubeapi",copy-lines="3"}
|
```shell {label="kubeapi",copy-lines="3"}
|
||||||
kubectl api-resources
|
kubectl api-resources
|
||||||
|
|
@ -85,9 +87,9 @@ mydatabases.example.org v1alpha1 true
|
||||||
{{<hint "warning">}}
|
{{<hint "warning">}}
|
||||||
You can't change the XRD
|
You can't change the XRD
|
||||||
{{<hover label="xrd1" line="6">}}group{{</hover>}} or
|
{{<hover label="xrd1" line="6">}}group{{</hover>}} or
|
||||||
{{<hover label="xrd1" line="7">}}names{{</hover>}}.
|
{{<hover label="xrd1" line="7">}}names{{</hover>}}.
|
||||||
You must delete and
|
You must delete and
|
||||||
recreate the XRD to change the
|
recreate the XRD to change the
|
||||||
{{<hover label="xrd1" line="6">}}group{{</hover>}} or
|
{{<hover label="xrd1" line="6">}}group{{</hover>}} or
|
||||||
{{<hover label="xrd1" line="7">}}names{{</hover>}}.
|
{{<hover label="xrd1" line="7">}}names{{</hover>}}.
|
||||||
{{</hint >}}
|
{{</hint >}}
|
||||||
|
|
@ -102,9 +104,9 @@ Groups define a collection of related API endpoints. The `group` can be any
|
||||||
value, but common convention is to map to a fully qualified domain name.
|
value, but common convention is to map to a fully qualified domain name.
|
||||||
|
|
||||||
<!-- vale write-good.Weasel = NO -->
|
<!-- vale write-good.Weasel = NO -->
|
||||||
Many XRDs may use the same `group` to create a logical collection of APIs.
|
Many XRDs may use the same `group` to create a logical collection of APIs.
|
||||||
<!-- vale write-good.Weasel = YES -->
|
<!-- vale write-good.Weasel = YES -->
|
||||||
For example a `database` group may have a `relational` and `nosql` kinds.
|
For example a `database` group may have a `relational` and `nosql` kinds.
|
||||||
|
|
||||||
<!-- vale Google.Headings = NO -->
|
<!-- vale Google.Headings = NO -->
|
||||||
<!-- vale Microsoft.Headings = NO -->
|
<!-- vale Microsoft.Headings = NO -->
|
||||||
|
|
@ -112,33 +114,33 @@ For example a `database` group may have a `relational` and `nosql` kinds.
|
||||||
<!-- vale Google.Headings = YES -->
|
<!-- vale Google.Headings = YES -->
|
||||||
<!-- vale Microsoft.Headings = YES -->
|
<!-- vale Microsoft.Headings = YES -->
|
||||||
|
|
||||||
The `names` field defines how to refer to this specific XRD.
|
The `names` field defines how to refer to this specific XRD.
|
||||||
The required name fields are:
|
The required name fields are:
|
||||||
|
|
||||||
* `kind` - the `kind` value to use when calling this API. The kind is
|
* `kind` - the `kind` value to use when calling this API. The kind is
|
||||||
[UpperCamelCased](https://kubernetes.io/docs/contribute/style/style-guide/#use-upper-camel-case-for-api-objects).
|
[UpperCamelCased](https://kubernetes.io/docs/contribute/style/style-guide/#use-upper-camel-case-for-api-objects).
|
||||||
Crossplane recommends starting XRD `kinds` with an `X` to show
|
Crossplane recommends starting XRD `kinds` with an `X` to show
|
||||||
it's a custom Crossplane API definition.
|
it's a custom Crossplane API definition.
|
||||||
* `plural` - the plural name used for the API URL. The plural name must be
|
* `plural` - the plural name used for the API URL. The plural name must be
|
||||||
lowercase.
|
lowercase.
|
||||||
|
|
||||||
{{<hint "important" >}}
|
{{<hint "important" >}}
|
||||||
The XRD
|
The XRD
|
||||||
{{<hover label="xrdName" line="4">}}metadata.name{{</hover>}} must be
|
{{<hover label="xrdName" line="4">}}metadata.name{{</hover>}} must be
|
||||||
{{<hover label="xrdName" line="9">}}plural{{</hover>}} name, `.` (dot character),
|
{{<hover label="xrdName" line="9">}}plural{{</hover>}} name, `.` (dot character),
|
||||||
{{<hover label="xrdName" line="6">}}group{{</hover>}}.
|
{{<hover label="xrdName" line="6">}}group{{</hover>}}.
|
||||||
|
|
||||||
For example, {{<hover label="xrdName"
|
For example, {{<hover label="xrdName"
|
||||||
line="4">}}mydatabases.example.org{{</hover>}} matches the {{<hover
|
line="4">}}mydatabases.example.org{{</hover>}} matches the {{<hover
|
||||||
label="xrdName" line="9">}}plural{{</hover>}} name
|
label="xrdName" line="9">}}plural{{</hover>}} name
|
||||||
{{<hover label="xrdName" line="9">}}mydatabases{{</hover>}}, `.`
|
{{<hover label="xrdName" line="9">}}mydatabases{{</hover>}}, `.`
|
||||||
{{<hover label="xrdName" line="6">}}group{{</hover>}} name,
|
{{<hover label="xrdName" line="6">}}group{{</hover>}} name,
|
||||||
{{<hover label="xrdName" line="6">}}example.org{{</hover>}}.
|
{{<hover label="xrdName" line="6">}}example.org{{</hover>}}.
|
||||||
|
|
||||||
```yaml {label="xrdName",copy-lines="none"}
|
```yaml {label="xrdName",copy-lines="none"}
|
||||||
apiVersion: apiextensions.crossplane.io/v1
|
apiVersion: apiextensions.crossplane.io/v1
|
||||||
kind: CompositeResourceDefinition
|
kind: CompositeResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: mydatabases.example.org
|
name: mydatabases.example.org
|
||||||
spec:
|
spec:
|
||||||
group: example.org
|
group: example.org
|
||||||
|
|
@ -156,21 +158,21 @@ spec:
|
||||||
<!-- vale Microsoft.Headings = YES -->
|
<!-- vale Microsoft.Headings = YES -->
|
||||||
|
|
||||||
<!-- vale gitlab.SentenceLength = NO -->
|
<!-- vale gitlab.SentenceLength = NO -->
|
||||||
The XRD `version` is like the
|
The XRD `version` is like the
|
||||||
[API versioning used by Kubernetes](https://kubernetes.io/docs/reference/using-api/#api-versioning).
|
[API versioning used by Kubernetes](https://kubernetes.io/docs/reference/using-api/#api-versioning).
|
||||||
The version shows how mature or stable the API is and increments when changing,
|
The version shows how mature or stable the API is and increments when changing,
|
||||||
adding or removing fields in the API.
|
adding or removing fields in the API.
|
||||||
<!-- vale gitlab.SentenceLength = YES -->
|
<!-- vale gitlab.SentenceLength = YES -->
|
||||||
|
|
||||||
Crossplane doesn't require specific versions or a specific version naming
|
Crossplane doesn't require specific versions or a specific version naming
|
||||||
convention, but following
|
convention, but following
|
||||||
[Kubernetes API versioning guidelines](https://kubernetes.io/docs/reference/using-api/#api-versioning)
|
[Kubernetes API versioning guidelines](https://kubernetes.io/docs/reference/using-api/#api-versioning)
|
||||||
is strongly recommended.
|
is strongly recommended.
|
||||||
|
|
||||||
* `v1alpha1` - A new API that may change at any time.
|
* `v1alpha1` - A new API that may change at any time.
|
||||||
* `v1beta1` - An existing API that's considered stable. Breaking changes are
|
* `v1beta1` - An existing API that's considered stable. Breaking changes are
|
||||||
strongly discouraged.
|
strongly discouraged.
|
||||||
* `v1` - A stable API that doesn't have breaking changes.
|
* `v1` - A stable API that doesn't have breaking changes.
|
||||||
|
|
||||||
#### Define a schema
|
#### Define a schema
|
||||||
|
|
||||||
|
|
@ -178,24 +180,24 @@ is strongly recommended.
|
||||||
<!-- vale write-good.TooWordy = NO -->
|
<!-- vale write-good.TooWordy = NO -->
|
||||||
The `schema` defines the names
|
The `schema` defines the names
|
||||||
of the parameters, the data types of the parameters and which parameters are
|
of the parameters, the data types of the parameters and which parameters are
|
||||||
required or optional.
|
required or optional.
|
||||||
<!-- vale write-good.Passive = YES -->
|
<!-- vale write-good.Passive = YES -->
|
||||||
<!-- vale write-good.TooWordy = YES -->
|
<!-- vale write-good.TooWordy = YES -->
|
||||||
|
|
||||||
{{<hint "note" >}}
|
{{<hint "note" >}}
|
||||||
All `schemas` follow the Kubernetes custom resource definition
|
All `schemas` follow the Kubernetes custom resource definition
|
||||||
[OpenAPIv3 structural schema](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#specifying-a-structural-schema).
|
[OpenAPIv3 structural schema](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#specifying-a-structural-schema).
|
||||||
{{< /hint >}}
|
{{< /hint >}}
|
||||||
|
|
||||||
Each
|
Each
|
||||||
{{<hover label="schema" line="11">}}version{{</hover>}} of the API has a unique
|
{{<hover label="schema" line="11">}}version{{</hover>}} of the API has a unique
|
||||||
{{<hover label="schema" line="12">}}schema{{</hover>}}.
|
{{<hover label="schema" line="12">}}schema{{</hover>}}.
|
||||||
|
|
||||||
All XRD {{<hover label="schema" line="12">}}schemas{{</hover>}} validate against
|
All XRD {{<hover label="schema" line="12">}}schemas{{</hover>}} validate against
|
||||||
the {{<hover label="schema" line="13">}}openAPIV3Schema{{</hover>}}. The schema
|
the {{<hover label="schema" line="13">}}openAPIV3Schema{{</hover>}}. The schema
|
||||||
is an OpenAPI
|
is an OpenAPI
|
||||||
{{<hover label="schema" line="14">}}object{{</hover>}} with the
|
{{<hover label="schema" line="14">}}object{{</hover>}} with the
|
||||||
{{<hover label="schema" line="15">}}properties{{</hover>}} of a
|
{{<hover label="schema" line="15">}}properties{{</hover>}} of a
|
||||||
{{<hover label="schema" line="16">}}spec{{</hover>}}
|
{{<hover label="schema" line="16">}}spec{{</hover>}}
|
||||||
{{<hover label="schema" line="17">}}object{{</hover>}}.
|
{{<hover label="schema" line="17">}}object{{</hover>}}.
|
||||||
|
|
||||||
|
|
@ -229,31 +231,31 @@ spec:
|
||||||
# Removed for brevity
|
# Removed for brevity
|
||||||
```
|
```
|
||||||
|
|
||||||
A composite resource using this API references the
|
A composite resource using this API references the
|
||||||
{{<hover label="xr" line="1">}}group/version{{</hover>}} and
|
{{<hover label="xr" line="1">}}group/version{{</hover>}} and
|
||||||
{{<hover label="xr" line="2">}}kind{{</hover>}}. The
|
{{<hover label="xr" line="2">}}kind{{</hover>}}. The
|
||||||
{{<hover label="xr" line="5">}}spec{{</hover>}} has the
|
{{<hover label="xr" line="5">}}spec{{</hover>}} has the
|
||||||
{{<hover label="xr" line="6">}}region{{</hover>}} key with a string value.
|
{{<hover label="xr" line="6">}}region{{</hover>}} key with a string value.
|
||||||
|
|
||||||
```yaml {label="xr"}
|
```yaml {label="xr"}
|
||||||
apiVersion: custom-api.example.org/v1alpha1
|
apiVersion: custom-api.example.org/v1alpha1
|
||||||
kind: xDatabase
|
kind: xDatabase
|
||||||
metadata:
|
metadata:
|
||||||
name: my-composite-resource
|
name: my-composite-resource
|
||||||
spec:
|
spec:
|
||||||
region: "US"
|
region: "US"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
{{<hint "tip" >}}
|
{{<hint "tip" >}}
|
||||||
The custom API defined inside the
|
The custom API defined inside the
|
||||||
{{<hover label="schema" line="18">}}spec.properties{{</hover>}} is an OpenAPIv3
|
{{<hover label="schema" line="18">}}spec.properties{{</hover>}} is an OpenAPIv3
|
||||||
specification. The
|
specification. The
|
||||||
[data models page](https://swagger.io/docs/specification/data-models/) of
|
[data models page](https://swagger.io/docs/specification/data-models/) of
|
||||||
the Swagger documentation provides a list of examples using data types and input
|
the Swagger documentation provides a list of examples using data types and input
|
||||||
restrictions.
|
restrictions.
|
||||||
|
|
||||||
The Kubernetes documentation lists
|
The Kubernetes documentation lists
|
||||||
[the set of special restrictions](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#validation)
|
[the set of special restrictions](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#validation)
|
||||||
on what your OpenAPIv3 custom API can use.
|
on what your OpenAPIv3 custom API can use.
|
||||||
{{< /hint >}}
|
{{< /hint >}}
|
||||||
|
|
@ -266,13 +268,13 @@ Changing or expanding the XRD schema requires restarting the [Crossplane pod]({{
|
||||||
##### Required fields
|
##### Required fields
|
||||||
|
|
||||||
By default all fields in a schema are optional. Define a parameter as required
|
By default all fields in a schema are optional. Define a parameter as required
|
||||||
with the
|
with the
|
||||||
{{< hover label="required" line="25">}}required{{</hover>}} attribute.
|
{{< hover label="required" line="25">}}required{{</hover>}} attribute.
|
||||||
|
|
||||||
In this example the XRD requires
|
In this example the XRD requires
|
||||||
{{< hover label="required" line="19">}}region{{</hover>}} and
|
{{< hover label="required" line="19">}}region{{</hover>}} and
|
||||||
{{< hover label="required" line="21">}}size{{</hover>}} but
|
{{< hover label="required" line="21">}}size{{</hover>}} but
|
||||||
{{< hover label="required" line="23">}}name{{</hover>}} is optional.
|
{{< hover label="required" line="23">}}name{{</hover>}} is optional.
|
||||||
```yaml {label="required",copy-lines="none"}
|
```yaml {label="required",copy-lines="none"}
|
||||||
apiVersion: apiextensions.crossplane.io/v1
|
apiVersion: apiextensions.crossplane.io/v1
|
||||||
kind: CompositeResourceDefinition
|
kind: CompositeResourceDefinition
|
||||||
|
|
@ -293,13 +295,13 @@ spec:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
region:
|
region:
|
||||||
type: string
|
type: string
|
||||||
size:
|
size:
|
||||||
type: string
|
type: string
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- region
|
- region
|
||||||
- size
|
- size
|
||||||
# Removed for brevity
|
# Removed for brevity
|
||||||
```
|
```
|
||||||
|
|
@ -312,15 +314,15 @@ This XRD defines two objects:
|
||||||
1. the top-level {{<hover label="required2" line="7">}}spec{{</hover>}} object
|
1. the top-level {{<hover label="required2" line="7">}}spec{{</hover>}} object
|
||||||
2. a second {{<hover label="required2" line="14">}}location{{</hover>}} object
|
2. a second {{<hover label="required2" line="14">}}location{{</hover>}} object
|
||||||
|
|
||||||
The {{<hover label="required2" line="7">}}spec{{</hover>}} object
|
The {{<hover label="required2" line="7">}}spec{{</hover>}} object
|
||||||
{{<hover label="required2" line="23">}}requires{{</hover>}} the
|
{{<hover label="required2" line="23">}}requires{{</hover>}} the
|
||||||
{{<hover label="required2" line="10">}}size{{</hover>}} and
|
{{<hover label="required2" line="10">}}size{{</hover>}} and
|
||||||
{{<hover label="required2" line="14">}}location{{</hover>}} but
|
{{<hover label="required2" line="14">}}location{{</hover>}} but
|
||||||
{{<hover label="required2" line="12">}}name{{</hover>}} is optional.
|
{{<hover label="required2" line="12">}}name{{</hover>}} is optional.
|
||||||
|
|
||||||
Inside the required {{<hover label="required2" line="14">}}location{{</hover>}}
|
Inside the required {{<hover label="required2" line="14">}}location{{</hover>}}
|
||||||
object,
|
object,
|
||||||
{{<hover label="required2" line="17">}}country{{</hover>}} is
|
{{<hover label="required2" line="17">}}country{{</hover>}} is
|
||||||
{{<hover label="required2" line="21">}}required{{</hover>}} and
|
{{<hover label="required2" line="21">}}required{{</hover>}} and
|
||||||
{{<hover label="required2" line="19">}}zone{{</hover>}} is optional.
|
{{<hover label="required2" line="19">}}zone{{</hover>}} is optional.
|
||||||
|
|
||||||
|
|
@ -335,25 +337,25 @@ object,
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
size:
|
size:
|
||||||
type: string
|
type: string
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
location:
|
location:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
country:
|
country:
|
||||||
type: string
|
type: string
|
||||||
zone:
|
zone:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- country
|
- country
|
||||||
required:
|
required:
|
||||||
- size
|
- size
|
||||||
- location
|
- location
|
||||||
```
|
```
|
||||||
|
|
||||||
The Swagger "[Describing Parameters](https://swagger.io/docs/specification/describing-parameters/)"
|
The Swagger "[Describing Parameters](https://swagger.io/docs/specification/describing-parameters/)"
|
||||||
documentation has more examples.
|
documentation has more examples.
|
||||||
|
|
||||||
##### Crossplane reserved fields
|
##### Crossplane reserved fields
|
||||||
|
|
||||||
|
|
@ -368,7 +370,7 @@ Crossplane ignores any fields matching the reserved fields.
|
||||||
|
|
||||||
To use a schema it must be
|
To use a schema it must be
|
||||||
{{<hover label="served" line="12" >}}served: true{{</hover >}}
|
{{<hover label="served" line="12" >}}served: true{{</hover >}}
|
||||||
and
|
and
|
||||||
{{<hover label="served" line="13" >}}referenceable: true{{</hover>}}.
|
{{<hover label="served" line="13" >}}referenceable: true{{</hover>}}.
|
||||||
|
|
||||||
```yaml {label="served"}
|
```yaml {label="served"}
|
||||||
|
|
@ -393,26 +395,26 @@ spec:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
region:
|
region:
|
||||||
type: string
|
type: string
|
||||||
```
|
```
|
||||||
|
|
||||||
Composite resources can use any schema version set as
|
Composite resources can use any schema version set as
|
||||||
{{<hover label="served" line="12" >}}served: true{{</hover >}}.
|
{{<hover label="served" line="12" >}}served: true{{</hover >}}.
|
||||||
Kubernetes rejects any composite resource using a schema version set as `served:
|
Kubernetes rejects any composite resource using a schema version set as `served:
|
||||||
false`.
|
false`.
|
||||||
|
|
||||||
{{< hint "tip" >}}
|
{{< hint "tip" >}}
|
||||||
Setting a schema version as `served:false` causes errors for users using an older
|
Setting a schema version as `served:false` causes errors for users using an older
|
||||||
schema. This can be an effective way to identify and upgrade users before
|
schema. This can be an effective way to identify and upgrade users before
|
||||||
deleting the older schema version.
|
deleting the older schema version.
|
||||||
{{< /hint >}}
|
{{< /hint >}}
|
||||||
|
|
||||||
The {{<hover label="served" line="13" >}}referenceable: true{{</hover>}}
|
The {{<hover label="served" line="13" >}}referenceable: true{{</hover>}}
|
||||||
field indicates which version of the schema Compositions use. Only one
|
field indicates which version of the schema Compositions use. Only one
|
||||||
version can be `referenceable`.
|
version can be `referenceable`.
|
||||||
|
|
||||||
{{< hint "note" >}}
|
{{< hint "note" >}}
|
||||||
Changing which version is `referenceable:true` requires [updating the `compositeTypeRef.apiVersion`]({{<ref "./compositions#match-composite-resources" >}})
|
Changing which version is `referenceable:true` requires [updating the `compositeTypeRef.apiVersion`]({{<ref "./compositions#match-composite-resources" >}})
|
||||||
of any Compositions referencing that XRD.
|
of any Compositions referencing that XRD.
|
||||||
{{< /hint >}}
|
{{< /hint >}}
|
||||||
|
|
||||||
|
|
@ -431,27 +433,27 @@ a "breaking change."
|
||||||
<!-- vale Crossplane.Spelling = NO -->
|
<!-- vale Crossplane.Spelling = NO -->
|
||||||
<!-- ignore to allow for CRDs -->
|
<!-- ignore to allow for CRDs -->
|
||||||
<!-- don't add to the spelling exceptions to catch when it's used instead of XRD -->
|
<!-- don't add to the spelling exceptions to catch when it's used instead of XRD -->
|
||||||
Crossplane XRDs use Kubernetes custom resource definitions for versioning.
|
Crossplane XRDs use Kubernetes custom resource definitions for versioning.
|
||||||
Read the Kubernetes documentation on
|
Read the Kubernetes documentation on
|
||||||
[versions in CustomResourceDefinitions](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/)
|
[versions in CustomResourceDefinitions](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/)
|
||||||
for more background on versions and breaking changes.
|
for more background on versions and breaking changes.
|
||||||
<!-- vale Crossplane.Spelling = YES -->
|
<!-- vale Crossplane.Spelling = YES -->
|
||||||
|
|
||||||
Crossplane recommends implementing breaking schema changes as brand new XRDs.
|
Crossplane recommends implementing breaking schema changes as brand new XRDs.
|
||||||
{{< /hint >}}
|
{{< /hint >}}
|
||||||
|
|
||||||
For XRDs, to create a new version of an API add a new
|
For XRDs, to create a new version of an API add a new
|
||||||
{{<hover label="ver" line="21">}}name{{</hover>}} in the
|
{{<hover label="ver" line="21">}}name{{</hover>}} in the
|
||||||
{{<hover label="ver" line="10">}}versions{{</hover>}}
|
{{<hover label="ver" line="10">}}versions{{</hover>}}
|
||||||
list.
|
list.
|
||||||
|
|
||||||
For example, this XRD version
|
For example, this XRD version
|
||||||
{{<hover label="ver" line="11">}}v1alpha1{{</hover>}} only has the field
|
{{<hover label="ver" line="11">}}v1alpha1{{</hover>}} only has the field
|
||||||
{{<hover label="ver" line="19">}}region{{</hover>}}.
|
{{<hover label="ver" line="19">}}region{{</hover>}}.
|
||||||
|
|
||||||
A second version,
|
A second version,
|
||||||
{{<hover label="ver" line="21">}}v1{{</hover>}} expands the API to have both
|
{{<hover label="ver" line="21">}}v1{{</hover>}} expands the API to have both
|
||||||
{{<hover label="ver" line="29">}}region{{</hover>}} and
|
{{<hover label="ver" line="29">}}region{{</hover>}} and
|
||||||
{{<hover label="ver" line="31">}}size{{</hover>}}.
|
{{<hover label="ver" line="31">}}size{{</hover>}}.
|
||||||
|
|
||||||
```yaml {label="ver",copy-lines="none"}
|
```yaml {label="ver",copy-lines="none"}
|
||||||
|
|
@ -474,7 +476,7 @@ spec:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
region:
|
region:
|
||||||
type: string
|
type: string
|
||||||
- name: v1
|
- name: v1
|
||||||
schema:
|
schema:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
|
|
@ -484,9 +486,9 @@ spec:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
region:
|
region:
|
||||||
type: string
|
type: string
|
||||||
size:
|
size:
|
||||||
type: string
|
type: string
|
||||||
```
|
```
|
||||||
|
|
||||||
{{<hint "important" >}}
|
{{<hint "important" >}}
|
||||||
|
|
@ -494,6 +496,41 @@ spec:
|
||||||
Changing or expanding the XRD schema requires restarting the [Crossplane pod]({{<ref "../guides/pods#crossplane-pod">}}) to take effect.
|
Changing or expanding the XRD schema requires restarting the [Crossplane pod]({{<ref "../guides/pods#crossplane-pod">}}) to take effect.
|
||||||
{{< /hint >}}
|
{{< /hint >}}
|
||||||
|
|
||||||
|
<!-- vale Google.Headings = NO -->
|
||||||
|
<!-- vale Microsoft.Headings = NO -->
|
||||||
|
### XRD scope
|
||||||
|
<!-- vale Google.Headings = YES -->
|
||||||
|
<!-- vale Microsoft.Headings = YES -->
|
||||||
|
|
||||||
|
The {{<hover label="xrdscope" line="6">}}scope{{</hover>}} field determines
|
||||||
|
whether composite resources created from this XRD exist in a namespace or
|
||||||
|
at cluster scope.
|
||||||
|
|
||||||
|
```yaml {label="xrdscope",copy-lines="none"}
|
||||||
|
apiVersion: apiextensions.crossplane.io/v2
|
||||||
|
kind: CompositeResourceDefinition
|
||||||
|
metadata:
|
||||||
|
name: mydatabases.example.org
|
||||||
|
spec:
|
||||||
|
scope: Namespaced
|
||||||
|
# Removed for brevity
|
||||||
|
```
|
||||||
|
|
||||||
|
The scope field supports three values:
|
||||||
|
|
||||||
|
* `Namespaced` - **(Default in v2)** - Composite resources exist in a
|
||||||
|
namespace and can only compose resources in the same namespace.
|
||||||
|
* `Cluster` - Composite resources are cluster-scoped and can compose resources
|
||||||
|
in any namespace or at cluster scope.
|
||||||
|
* `LegacyCluster` - Cluster-scoped with support for claims (v1 compatibility
|
||||||
|
mode).
|
||||||
|
|
||||||
|
{{<hint "note" >}}
|
||||||
|
Most XRDs should use `Namespaced` scope. This provides better security
|
||||||
|
isolation and follows standard Kubernetes patterns. Use `Cluster` scope only
|
||||||
|
for platform level resources like RBAC or cluster configuration.
|
||||||
|
{{< /hint >}}
|
||||||
|
|
||||||
### Set composite resource defaults
|
### Set composite resource defaults
|
||||||
XRDs can set default parameters for composite resources.
|
XRDs can set default parameters for composite resources.
|
||||||
|
|
||||||
|
|
@ -502,13 +539,13 @@ XRDs can set default parameters for composite resources.
|
||||||
<!-- vale on -->
|
<!-- vale on -->
|
||||||
It's possible for multiple [Compositions]({{<ref "./compositions">}}) to
|
It's possible for multiple [Compositions]({{<ref "./compositions">}}) to
|
||||||
reference the same XRD. If more than one Composition references the same XRD,
|
reference the same XRD. If more than one Composition references the same XRD,
|
||||||
the composite resource must select which Composition to use.
|
the composite resource must select which Composition to use.
|
||||||
|
|
||||||
An XRD can define the default Composition to use with the
|
An XRD can define the default Composition to use with the
|
||||||
`defaultCompositionRef` value.
|
`defaultCompositionRef` value.
|
||||||
|
|
||||||
Set a
|
Set a
|
||||||
{{<hover label="defaultComp" line="6">}}defaultCompositionRef{{</hover>}}
|
{{<hover label="defaultComp" line="6">}}defaultCompositionRef{{</hover>}}
|
||||||
to set the default Composition.
|
to set the default Composition.
|
||||||
|
|
||||||
```yaml {label="defaultComp",copy-lines="none"}
|
```yaml {label="defaultComp",copy-lines="none"}
|
||||||
|
|
@ -517,7 +554,7 @@ kind: CompositeResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: xdatabases.custom-api.example.org
|
name: xdatabases.custom-api.example.org
|
||||||
spec:
|
spec:
|
||||||
defaultCompositionRef:
|
defaultCompositionRef:
|
||||||
name: myComposition
|
name: myComposition
|
||||||
group: custom-api.example.org
|
group: custom-api.example.org
|
||||||
names:
|
names:
|
||||||
|
|
@ -531,10 +568,10 @@ spec:
|
||||||
<!-- vale on -->
|
<!-- vale on -->
|
||||||
|
|
||||||
Changes to a Composition generate a new Composition revision. By default all
|
Changes to a Composition generate a new Composition revision. By default all
|
||||||
composite resources use the updated Composition revision.
|
composite resources use the updated Composition revision.
|
||||||
|
|
||||||
Set the XRD `defaultCompositionUpdatePolicy` to `Manual` to prevent composite
|
Set the XRD `defaultCompositionUpdatePolicy` to `Manual` to prevent composite
|
||||||
resources from automatically using the new revision.
|
resources from automatically using the new revision.
|
||||||
|
|
||||||
The default value is `defaultCompositionUpdatePolicy: Automatic`.
|
The default value is `defaultCompositionUpdatePolicy: Automatic`.
|
||||||
|
|
||||||
|
|
@ -563,9 +600,9 @@ To require all composite resources to use a specific Composition use the
|
||||||
`enforcedCompositionRef` setting in the XRD.
|
`enforcedCompositionRef` setting in the XRD.
|
||||||
|
|
||||||
For example, to require all composite resources using this XRD to use the
|
For example, to require all composite resources using this XRD to use the
|
||||||
Composition
|
Composition
|
||||||
{{<hover label="enforceComp" line="6">}}myComposition{{</hover>}}
|
{{<hover label="enforceComp" line="6">}}myComposition{{</hover>}}
|
||||||
set
|
set
|
||||||
{{<hover label="enforceComp" line="6">}}enforcedCompositionRef.name: myComposition{{</hover>}}.
|
{{<hover label="enforceComp" line="6">}}enforcedCompositionRef.name: myComposition{{</hover>}}.
|
||||||
|
|
||||||
```yaml {label="defaultComp",copy-lines="none"}
|
```yaml {label="defaultComp",copy-lines="none"}
|
||||||
|
|
@ -574,7 +611,7 @@ kind: CompositeResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: xdatabases.custom-api.example.org
|
name: xdatabases.custom-api.example.org
|
||||||
spec:
|
spec:
|
||||||
enforcedCompositionRef:
|
enforcedCompositionRef:
|
||||||
name: myComposition
|
name: myComposition
|
||||||
group: custom-api.example.org
|
group: custom-api.example.org
|
||||||
names:
|
names:
|
||||||
|
|
@ -589,11 +626,11 @@ spec:
|
||||||
<!-- vale Google.Headings = YES -->
|
<!-- vale Google.Headings = YES -->
|
||||||
<!-- vale Microsoft.Headings = YES -->
|
<!-- vale Microsoft.Headings = YES -->
|
||||||
|
|
||||||
Verify an XRD with `kubectl get compositeresourcedefinition` or the short form,
|
Verify an XRD with `kubectl get compositeresourcedefinition` or the short form,
|
||||||
{{<hover label="getxrd" line="1">}}kubectl get xrd{{</hover>}}.
|
{{<hover label="getxrd" line="1">}}kubectl get xrd{{</hover>}}.
|
||||||
|
|
||||||
```yaml {label="getxrd",copy-lines="1"}
|
```yaml {label="getxrd",copy-lines="1"}
|
||||||
kubectl get xrd
|
kubectl get xrd
|
||||||
NAME ESTABLISHED OFFERED AGE
|
NAME ESTABLISHED OFFERED AGE
|
||||||
xdatabases.custom-api.example.org True True 22m
|
xdatabases.custom-api.example.org True True 22m
|
||||||
```
|
```
|
||||||
|
|
@ -606,9 +643,9 @@ resource definition for this XRD.
|
||||||
### XRD conditions
|
### XRD conditions
|
||||||
<!-- vale Google.Headings = YES -->
|
<!-- vale Google.Headings = YES -->
|
||||||
<!-- vale Microsoft.Headings = YES -->
|
<!-- vale Microsoft.Headings = YES -->
|
||||||
Crossplane uses a standard set of `Conditions` for XRDs.
|
Crossplane uses a standard set of `Conditions` for XRDs.
|
||||||
View the conditions of a XRD under their `Status` with
|
View the conditions of a XRD under their `Status` with
|
||||||
`kubectl describe xrd`.
|
`kubectl describe xrd`.
|
||||||
|
|
||||||
```yaml {copy-lines="none"}
|
```yaml {copy-lines="none"}
|
||||||
kubectl describe xrd
|
kubectl describe xrd
|
||||||
|
|
@ -628,8 +665,8 @@ Status:
|
||||||
#### WatchingCompositeResource
|
#### WatchingCompositeResource
|
||||||
<!-- vale on -->
|
<!-- vale on -->
|
||||||
`Reason: WatchingCompositeResource` indicates Crossplane defined the new
|
`Reason: WatchingCompositeResource` indicates Crossplane defined the new
|
||||||
Kubernetes custom resource definitions related to the composite resource and is
|
Kubernetes custom resource definitions related to the composite resource and is
|
||||||
watching for the creation of new composite resources.
|
watching for the creation of new composite resources.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
Type: Established
|
Type: Established
|
||||||
|
|
@ -641,7 +678,7 @@ Reason: WatchingCompositeResource
|
||||||
#### TerminatingCompositeResource
|
#### TerminatingCompositeResource
|
||||||
<!-- vale on -->
|
<!-- vale on -->
|
||||||
`Reason: TerminatingCompositeResource` indicates Crossplane is deleting the
|
`Reason: TerminatingCompositeResource` indicates Crossplane is deleting the
|
||||||
custom resource definitions related to the composite resource and is
|
custom resource definitions related to the composite resource and is
|
||||||
terminating the composite resource controller.
|
terminating the composite resource controller.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,10 @@ database configuration of an Azure MySQL Server and some firewall rules. The
|
||||||
`Composition` contains the 'base' configuration for the MySQL server and the
|
`Composition` contains the 'base' configuration for the MySQL server and the
|
||||||
firewall rules that the `PlatformDB` configuration extends.
|
firewall rules that the `PlatformDB` configuration extends.
|
||||||
|
|
||||||
A `Composition` associates with multiple XRs that use it. You might
|
A `Composition` associates with multiple XRs that use it. You might
|
||||||
define a `Composition` named `big-platform-db` that's used by ten different
|
define a `Composition` named `big-platform-db` that's used by ten different
|
||||||
`PlatformDB` XRs. Often, in the interest of self-service, a different team manages the `Composition`
|
`PlatformDB` XRs. Often, in the interest of self-service, a different team manages the `Composition`
|
||||||
than the actual `PlatformDB` XRs. For example
|
than the actual `PlatformDB` XRs. For example
|
||||||
a platform team member may write and maintain the `Composition`,
|
a platform team member may write and maintain the `Composition`,
|
||||||
while individual app teams create `PlatformDB` XRs that use said
|
while individual app teams create `PlatformDB` XRs that use said
|
||||||
`Composition`.
|
`Composition`.
|
||||||
|
|
@ -88,6 +88,7 @@ manually update it when you wish it to use another `CompositionRevision`.
|
||||||
apiVersion: example.org/v1alpha1
|
apiVersion: example.org/v1alpha1
|
||||||
kind: PlatformDB
|
kind: PlatformDB
|
||||||
metadata:
|
metadata:
|
||||||
|
namespace: default
|
||||||
name: example
|
name: example
|
||||||
spec:
|
spec:
|
||||||
storageGB: 20
|
storageGB: 20
|
||||||
|
|
@ -108,6 +109,7 @@ use a different `CompositionRevision`.
|
||||||
apiVersion: example.org/v1alpha1
|
apiVersion: example.org/v1alpha1
|
||||||
kind: PlatformDB
|
kind: PlatformDB
|
||||||
metadata:
|
metadata:
|
||||||
|
namespace: default
|
||||||
name: example
|
name: example
|
||||||
spec:
|
spec:
|
||||||
storageGB: 20
|
storageGB: 20
|
||||||
|
|
@ -125,9 +127,9 @@ spec:
|
||||||
This tutorial discusses how CompositionRevisions work and how they manage Composite Resource
|
This tutorial discusses how CompositionRevisions work and how they manage Composite Resource
|
||||||
(XR) updates. This starts with a `Composition` and `CompositeResourceDefinition` (XRD) that defines a `MyVPC`
|
(XR) updates. This starts with a `Composition` and `CompositeResourceDefinition` (XRD) that defines a `MyVPC`
|
||||||
resource and continues with creating multiple XRs to observe different upgrade paths. Crossplane
|
resource and continues with creating multiple XRs to observe different upgrade paths. Crossplane
|
||||||
assigns different CompositionRevisions to composite resources each time you update the composition.
|
assigns different CompositionRevisions to composite resources each time you update the composition.
|
||||||
|
|
||||||
### Preparation
|
### Preparation
|
||||||
|
|
||||||
#### Deploy composition and XRD examples
|
#### Deploy composition and XRD examples
|
||||||
Apply the example Composition.
|
Apply the example Composition.
|
||||||
|
|
@ -177,18 +179,18 @@ spec:
|
||||||
plural: myvpcs
|
plural: myvpcs
|
||||||
versions:
|
versions:
|
||||||
- name: v1alpha1
|
- name: v1alpha1
|
||||||
served: true
|
served: true
|
||||||
referenceable: true
|
referenceable: true
|
||||||
schema:
|
schema:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
spec:
|
spec:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
type: string
|
type: string
|
||||||
description: ID of this VPC that other objects will use to refer to it.
|
description: ID of this VPC that other objects will use to refer to it.
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
```
|
```
|
||||||
|
|
@ -228,7 +230,7 @@ spec:
|
||||||
Expected Output:
|
Expected Output:
|
||||||
```shell
|
```shell
|
||||||
myvpc.aws.example.upbound.io/vpc-auto created
|
myvpc.aws.example.upbound.io/vpc-auto created
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Manual update policy
|
#### Manual update policy
|
||||||
Create a Composite Resource with `compositionUpdatePolicy: Manual` and `compositionRevisionRef`.
|
Create a Composite Resource with `compositionUpdatePolicy: Manual` and `compositionRevisionRef`.
|
||||||
|
|
@ -249,7 +251,7 @@ spec:
|
||||||
Expected Output:
|
Expected Output:
|
||||||
```shell
|
```shell
|
||||||
myvpc.aws.example.upbound.io/vpc-man created
|
myvpc.aws.example.upbound.io/vpc-man created
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Using a selector
|
#### Using a selector
|
||||||
Create an XR with a `compositionRevisionSelector` of `channel: dev`:
|
Create an XR with a `compositionRevisionSelector` of `channel: dev`:
|
||||||
|
|
@ -269,7 +271,7 @@ spec:
|
||||||
Expected Output:
|
Expected Output:
|
||||||
```shell
|
```shell
|
||||||
myvpc.aws.example.upbound.io/vpc-dev created
|
myvpc.aws.example.upbound.io/vpc-dev created
|
||||||
```
|
```
|
||||||
|
|
||||||
Create an XR with a `compositionRevisionSelector` of `channel: staging`:
|
Create an XR with a `compositionRevisionSelector` of `channel: staging`:
|
||||||
```yaml
|
```yaml
|
||||||
|
|
@ -289,9 +291,9 @@ spec:
|
||||||
Expected Output:
|
Expected Output:
|
||||||
```shell
|
```shell
|
||||||
myvpc.aws.example.upbound.io/vpc-staging created
|
myvpc.aws.example.upbound.io/vpc-staging created
|
||||||
```
|
```
|
||||||
|
|
||||||
Verify the Composite Resource with the label `channel: staging` doesn't have a `REVISION`.
|
Verify the Composite Resource with the label `channel: staging` doesn't have a `REVISION`.
|
||||||
All other XRs have a `REVISION` matching the created Composition Revision.
|
All other XRs have a `REVISION` matching the created Composition Revision.
|
||||||
```shell
|
```shell
|
||||||
kubectl get composite -o="custom-columns=NAME:.metadata.name,SYNCED:.status.conditions[0].status,REVISION:.spec.crossplane.compositionRevisionRef.name,POLICY:.spec.crossplane.compositionUpdatePolicy,MATCHLABEL:.spec.crossplane.compositionRevisionSelector.matchLabels"
|
kubectl get composite -o="custom-columns=NAME:.metadata.name,SYNCED:.status.conditions[0].status,REVISION:.spec.crossplane.compositionRevisionRef.name,POLICY:.spec.crossplane.compositionUpdatePolicy,MATCHLABEL:.spec.crossplane.compositionRevisionSelector.matchLabels"
|
||||||
|
|
@ -303,7 +305,7 @@ vpc-auto True myvpcs.aws.example.upbound.io-ad265bc Automatic <none
|
||||||
vpc-dev True myvpcs.aws.example.upbound.io-ad265bc Automatic map[channel:dev]
|
vpc-dev True myvpcs.aws.example.upbound.io-ad265bc Automatic map[channel:dev]
|
||||||
vpc-man True myvpcs.aws.example.upbound.io-ad265bc Manual <none>
|
vpc-man True myvpcs.aws.example.upbound.io-ad265bc Manual <none>
|
||||||
vpc-staging False <none> Automatic map[channel:staging]
|
vpc-staging False <none> Automatic map[channel:staging]
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< hint "note" >}}
|
{{< hint "note" >}}
|
||||||
The `vpc-staging` XR label doesn't match any existing Composition Revisions.
|
The `vpc-staging` XR label doesn't match any existing Composition Revisions.
|
||||||
|
|
@ -311,7 +313,7 @@ The `vpc-staging` XR label doesn't match any existing Composition Revisions.
|
||||||
|
|
||||||
### Create new composition revisions
|
### Create new composition revisions
|
||||||
Crossplane creates a new CompositionRevision when you create or update a Composition. Label and annotation changes
|
Crossplane creates a new CompositionRevision when you create or update a Composition. Label and annotation changes
|
||||||
also trigger a new CompositionRevision.
|
also trigger a new CompositionRevision.
|
||||||
|
|
||||||
#### Update the composition label
|
#### Update the composition label
|
||||||
Update the `Composition` label to `channel: staging`:
|
Update the `Composition` label to `channel: staging`:
|
||||||
|
|
@ -321,7 +323,7 @@ kubectl label composition myvpcs.aws.example.upbound.io channel=staging --overwr
|
||||||
Expected Output:
|
Expected Output:
|
||||||
```shell
|
```shell
|
||||||
composition.apiextensions.crossplane.io/myvpcs.aws.example.upbound.io labeled
|
composition.apiextensions.crossplane.io/myvpcs.aws.example.upbound.io labeled
|
||||||
```
|
```
|
||||||
|
|
||||||
Verify that Crossplane creates a new Composition revision:
|
Verify that Crossplane creates a new Composition revision:
|
||||||
```shell
|
```shell
|
||||||
|
|
@ -332,9 +334,9 @@ Expected Output:
|
||||||
NAME REVISION CHANNEL
|
NAME REVISION CHANNEL
|
||||||
myvpcs.aws.example.upbound.io-727b3c8 2 staging
|
myvpcs.aws.example.upbound.io-727b3c8 2 staging
|
||||||
myvpcs.aws.example.upbound.io-ad265bc 1 dev
|
myvpcs.aws.example.upbound.io-ad265bc 1 dev
|
||||||
```
|
```
|
||||||
|
|
||||||
Verify that Crossplane assigns the Composite Resources `vpc-auto` and `vpc-staging` to Composite `revision:2`.
|
Verify that Crossplane assigns the Composite Resources `vpc-auto` and `vpc-staging` to Composite `revision:2`.
|
||||||
XRs `vpc-man` and `vpc-dev` are still assigned to the original `revision:1`:
|
XRs `vpc-man` and `vpc-dev` are still assigned to the original `revision:1`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|
@ -347,10 +349,10 @@ vpc-auto True myvpcs.aws.example.upbound.io-727b3c8 Automatic <none
|
||||||
vpc-dev True myvpcs.aws.example.upbound.io-ad265bc Automatic map[channel:dev]
|
vpc-dev True myvpcs.aws.example.upbound.io-ad265bc Automatic map[channel:dev]
|
||||||
vpc-man True myvpcs.aws.example.upbound.io-ad265bc Manual <none>
|
vpc-man True myvpcs.aws.example.upbound.io-ad265bc Manual <none>
|
||||||
vpc-staging True myvpcs.aws.example.upbound.io-727b3c8 Automatic map[channel:staging]
|
vpc-staging True myvpcs.aws.example.upbound.io-727b3c8 Automatic map[channel:staging]
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< hint "note" >}}
|
{{< hint "note" >}}
|
||||||
`vpc-auto` always use the latest Revision.
|
`vpc-auto` always use the latest Revision.
|
||||||
`vpc-staging` now matches the label applied to Revision `revision:2`.
|
`vpc-staging` now matches the label applied to Revision `revision:2`.
|
||||||
{{< /hint >}}
|
{{< /hint >}}
|
||||||
|
|
||||||
|
|
@ -393,7 +395,7 @@ spec:
|
||||||
Expected Output:
|
Expected Output:
|
||||||
```shell
|
```shell
|
||||||
composition.apiextensions.crossplane.io/myvpcs.aws.example.upbound.io configured
|
composition.apiextensions.crossplane.io/myvpcs.aws.example.upbound.io configured
|
||||||
```
|
```
|
||||||
|
|
||||||
Verify that Crossplane creates a new Composition revision:
|
Verify that Crossplane creates a new Composition revision:
|
||||||
|
|
||||||
|
|
@ -406,13 +408,13 @@ NAME REVISION CHANNEL
|
||||||
myvpcs.aws.example.upbound.io-727b3c8 2 staging
|
myvpcs.aws.example.upbound.io-727b3c8 2 staging
|
||||||
myvpcs.aws.example.upbound.io-ad265bc 1 dev
|
myvpcs.aws.example.upbound.io-ad265bc 1 dev
|
||||||
myvpcs.aws.example.upbound.io-f81c553 3 dev
|
myvpcs.aws.example.upbound.io-f81c553 3 dev
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< hint "note" >}}
|
{{< hint "note" >}}
|
||||||
Changing the label and the spec values simultaneously is critical for deploying new changes to the `dev` channel.
|
Changing the label and the spec values simultaneously is critical for deploying new changes to the `dev` channel.
|
||||||
{{< /hint >}}
|
{{< /hint >}}
|
||||||
|
|
||||||
Verify Crossplane assigns the Composite Resources `vpc-auto` and `vpc-dev` to Composite `revision:3`.
|
Verify Crossplane assigns the Composite Resources `vpc-auto` and `vpc-dev` to Composite `revision:3`.
|
||||||
Crossplane assigns `vpc-staging` to `revision:2`, and still assigns `vpc-man` to the original `revision:1`:
|
Crossplane assigns `vpc-staging` to `revision:2`, and still assigns `vpc-man` to the original `revision:1`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|
@ -425,7 +427,7 @@ vpc-auto True myvpcs.aws.example.upbound.io-f81c553 Automatic <none
|
||||||
vpc-dev True myvpcs.aws.example.upbound.io-f81c553 Automatic map[channel:dev]
|
vpc-dev True myvpcs.aws.example.upbound.io-f81c553 Automatic map[channel:dev]
|
||||||
vpc-man True myvpcs.aws.example.upbound.io-ad265bc Manual <none>
|
vpc-man True myvpcs.aws.example.upbound.io-ad265bc Manual <none>
|
||||||
vpc-staging True myvpcs.aws.example.upbound.io-727b3c8 Automatic map[channel:staging]
|
vpc-staging True myvpcs.aws.example.upbound.io-727b3c8 Automatic map[channel:staging]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
{{< hint "note" >}}
|
{{< hint "note" >}}
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ that supports REST APIs to work with apps.
|
||||||
This guide requires:
|
This guide requires:
|
||||||
|
|
||||||
* A Kubernetes cluster with at least 2 GB of RAM
|
* A Kubernetes cluster with at least 2 GB of RAM
|
||||||
* The Crossplane v2 preview [installed on the Kubernetes cluster]({{<ref "install">}})
|
* Crossplane v2 [installed on the Kubernetes cluster]({{<ref "install">}})
|
||||||
|
|
||||||
## Create the custom resource
|
## Create the custom resource
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,16 +32,16 @@ Kubernetes calls third party API resources _custom resources_.
|
||||||
This guide requires:
|
This guide requires:
|
||||||
|
|
||||||
* A Kubernetes cluster with at least 2 GB of RAM
|
* A Kubernetes cluster with at least 2 GB of RAM
|
||||||
* The Crossplane v2 preview [installed on the Kubernetes cluster]({{<ref "install">}})
|
* Crossplane v2 [installed on the Kubernetes cluster]({{<ref "install">}})
|
||||||
* An AWS account with permissions to create an S3 storage bucket
|
* An AWS account with permissions to create an S3 storage bucket
|
||||||
* AWS [access keys](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html#cli-configure-quickstart-creds)
|
* AWS [access keys](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html#cli-configure-quickstart-creds)
|
||||||
|
|
||||||
{{<hint "note">}}
|
{{<hint "note">}}
|
||||||
Only AWS managed resources support the Crossplane v2 preview.
|
AWS managed resources fully support Crossplane v2.
|
||||||
|
|
||||||
<!-- vale gitlab.FutureTense = NO -->
|
<!-- vale gitlab.FutureTense = NO -->
|
||||||
Maintainers will update the managed resources for other systems including Azure,
|
Maintainers are actively working to update managed resources for other systems including Azure,
|
||||||
GCP, Terraform, Helm, GitHub, etc to support Crossplane v2 soon.
|
GCP, Terraform, Helm, GitHub, etc to support Crossplane v2.
|
||||||
<!-- vale gitlab.FutureTense = YES -->
|
<!-- vale gitlab.FutureTense = YES -->
|
||||||
{{</hint>}}
|
{{</hint>}}
|
||||||
|
|
||||||
|
|
@ -69,7 +69,7 @@ kind: Provider
|
||||||
metadata:
|
metadata:
|
||||||
name: crossplane-contrib-provider-aws-s3
|
name: crossplane-contrib-provider-aws-s3
|
||||||
spec:
|
spec:
|
||||||
package: xpkg.crossplane.io/crossplane-contrib/provider-aws-s3:v1.24.0-crossplane-v2-preview.0
|
package: xpkg.crossplane.io/crossplane-contrib/provider-aws-s3:v2.0.0
|
||||||
```
|
```
|
||||||
|
|
||||||
Save this as `provider.yaml` and apply it:
|
Save this as `provider.yaml` and apply it:
|
||||||
|
|
@ -83,8 +83,8 @@ Check that Crossplane installed the provider:
|
||||||
```shell {copy-lines="1",label="getProvider"}
|
```shell {copy-lines="1",label="getProvider"}
|
||||||
kubectl get providers
|
kubectl get providers
|
||||||
NAME INSTALLED HEALTHY PACKAGE AGE
|
NAME INSTALLED HEALTHY PACKAGE AGE
|
||||||
crossplane-contrib-provider-family-aws True True xpkg.crossplane.io/crossplane-contrib/provider-family-aws:v1.24.0-crossplane-v2-preview.0 27s
|
crossplane-contrib-provider-family-aws True True xpkg.crossplane.io/crossplane-contrib/provider-family-aws:v2.0.0 27s
|
||||||
crossplane-contrib-provider-aws-s3 True True xpkg.crossplane.io/crossplane-contrib/provider-aws-s3:v1.24.0-crossplane-v2-preview.0 31s
|
crossplane-contrib-provider-aws-s3 True True xpkg.crossplane.io/crossplane-contrib/provider-aws-s3:v2.0.0 31s
|
||||||
```
|
```
|
||||||
|
|
||||||
{{<hint "note">}}
|
{{<hint "note">}}
|
||||||
|
|
|
||||||
|
|
@ -28,14 +28,14 @@ Install Crossplane using the _Helm chart_.
|
||||||
|
|
||||||
<!-- vale Google.Headings = NO -->
|
<!-- vale Google.Headings = NO -->
|
||||||
<!-- vale Microsoft.Headings = NO -->
|
<!-- vale Microsoft.Headings = NO -->
|
||||||
### Add the Crossplane Preview Helm repository
|
### Add the Crossplane Helm repository
|
||||||
<!-- vale Google.Headings = YES -->
|
<!-- vale Google.Headings = YES -->
|
||||||
<!-- vale Microsoft.Headings = YES -->
|
<!-- vale Microsoft.Headings = YES -->
|
||||||
|
|
||||||
Add the Crossplane preview repository with the `helm repo add` command.
|
Add the Crossplane stable repository with the `helm repo add` command.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
helm repo add crossplane-preview https://charts.crossplane.io/preview
|
helm repo add crossplane-stable https://charts.crossplane.io/stable
|
||||||
```
|
```
|
||||||
|
|
||||||
Update the
|
Update the
|
||||||
|
|
@ -46,11 +46,11 @@ helm repo update
|
||||||
|
|
||||||
<!-- vale Google.Headings = NO -->
|
<!-- vale Google.Headings = NO -->
|
||||||
<!-- vale Microsoft.Headings = NO -->
|
<!-- vale Microsoft.Headings = NO -->
|
||||||
### Install the Crossplane Preview Helm chart
|
### Install the Crossplane Helm chart
|
||||||
<!-- vale Google.Headings = YES -->
|
<!-- vale Google.Headings = YES -->
|
||||||
<!-- vale Microsoft.Headings = YES -->
|
<!-- vale Microsoft.Headings = YES -->
|
||||||
|
|
||||||
Install the Crossplane Preview Helm chart with `helm install`.
|
Install the Crossplane Helm chart with `helm install`.
|
||||||
|
|
||||||
{{< hint "tip" >}}
|
{{< hint "tip" >}}
|
||||||
View the changes Crossplane makes to your cluster with the
|
View the changes Crossplane makes to your cluster with the
|
||||||
|
|
@ -63,8 +63,7 @@ Crossplane creates and installs into the `crossplane-system` namespace.
|
||||||
```shell
|
```shell
|
||||||
helm install crossplane \
|
helm install crossplane \
|
||||||
--namespace crossplane-system \
|
--namespace crossplane-system \
|
||||||
--create-namespace crossplane-preview/crossplane \
|
--create-namespace crossplane-stable/crossplane
|
||||||
--version v2.0.0-preview.1
|
|
||||||
```
|
```
|
||||||
|
|
||||||
View the installed Crossplane pods with `kubectl get pods -n crossplane-system`.
|
View the installed Crossplane pods with `kubectl get pods -n crossplane-system`.
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,14 @@ The recommended upgrade method for an existing Crossplane install is to use
|
||||||
* [Helm](https://helm.sh/docs/intro/install/) version `v3.2.0` or later
|
* [Helm](https://helm.sh/docs/intro/install/) version `v3.2.0` or later
|
||||||
|
|
||||||
|
|
||||||
## Add the Crossplane Preview Helm repository
|
## Add the Crossplane Helm repository
|
||||||
Verify Helm has the Crossplane repository.
|
Verify Helm has the Crossplane repository.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
helm repo add crossplane-preview https://charts.crossplane.io/preview
|
helm repo add crossplane-stable https://charts.crossplane.io/stable
|
||||||
```
|
```
|
||||||
|
|
||||||
## Update the Helm Preview repository
|
## Update the Helm repository
|
||||||
|
|
||||||
Update the local Crossplane Helm chart with `helm repo update`.
|
Update the local Crossplane Helm chart with `helm repo update`.
|
||||||
|
|
||||||
|
|
@ -37,7 +37,7 @@ By default, Crossplane installs into the `crossplane-system`
|
||||||
namespace.
|
namespace.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
helm upgrade crossplane --namespace crossplane-system crossplane-preview/crossplane --devel
|
helm upgrade crossplane --namespace crossplane-system crossplane-stable/crossplane
|
||||||
```
|
```
|
||||||
|
|
||||||
Helm preserves any arguments or flags originally used when installing
|
Helm preserves any arguments or flags originally used when installing
|
||||||
|
|
@ -56,5 +56,5 @@ with the upgrade command.
|
||||||
|
|
||||||
For example, to maintain the original image registry use
|
For example, to maintain the original image registry use
|
||||||
```shell
|
```shell
|
||||||
helm upgrade crossplane --namespace crossplane-system crossplane-preview/crossplane --set 'args={"--registry=index.docker.io"}'
|
helm upgrade crossplane --namespace crossplane-system crossplane-stable/crossplane --set 'args={"--registry=index.docker.io"}'
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,11 @@ Examples of managed resources include:
|
||||||
* Microsoft Azure PostgreSQL `Database` defined in [provider-upjet-azure](https://github.com/crossplane-contrib/provider-upjet-azure).
|
* Microsoft Azure PostgreSQL `Database` defined in [provider-upjet-azure](https://github.com/crossplane-contrib/provider-upjet-azure).
|
||||||
|
|
||||||
{{<hint "important">}}
|
{{<hint "important">}}
|
||||||
Only AWS managed resources support the Crossplane v2 preview.
|
AWS managed resources fully support Crossplane v2.
|
||||||
|
|
||||||
<!-- vale gitlab.FutureTense = NO -->
|
<!-- vale gitlab.FutureTense = NO -->
|
||||||
Maintainers will update the managed resources for other systems including Azure,
|
Maintainers are actively working to update managed resources for other systems including Azure,
|
||||||
GCP, Terraform, Helm, GitHub, etc to support Crossplane v2 soon.
|
GCP, Terraform, Helm, GitHub, etc to support Crossplane v2.
|
||||||
<!-- vale gitlab.FutureTense = YES -->
|
<!-- vale gitlab.FutureTense = YES -->
|
||||||
{{</hint>}}
|
{{</hint>}}
|
||||||
|
|
||||||
|
|
@ -419,7 +419,7 @@ For example, when creating an AWS RDS database instance with the Crossplane
|
||||||
[community AWS provider](https://github.com/crossplane-contrib/provider-aws)
|
[community AWS provider](https://github.com/crossplane-contrib/provider-aws)
|
||||||
generates an endpoint, password, port and username data. The Provider saves
|
generates an endpoint, password, port and username data. The Provider saves
|
||||||
these variables in the Kubernetes secret
|
these variables in the Kubernetes secret
|
||||||
{{<hover label="secretname" line="9" >}}rds-secret{{</hover>}}, referenced by
|
{{<hover label="secretname" line="10" >}}rds-secret{{</hover>}}, referenced by
|
||||||
the
|
the
|
||||||
{{<hover label="secretname" line="9" >}}writeConnectionSecretToRef{{</hover>}}
|
{{<hover label="secretname" line="9" >}}writeConnectionSecretToRef{{</hover>}}
|
||||||
field.
|
field.
|
||||||
|
|
@ -428,6 +428,7 @@ field.
|
||||||
apiVersion: database.aws.m.crossplane.io/v1beta1
|
apiVersion: database.aws.m.crossplane.io/v1beta1
|
||||||
kind: RDSInstance
|
kind: RDSInstance
|
||||||
metadata:
|
metadata:
|
||||||
|
namespace: default
|
||||||
name: my-rds-instance
|
name: my-rds-instance
|
||||||
spec:
|
spec:
|
||||||
forProvider:
|
forProvider:
|
||||||
|
|
|
||||||
|
|
@ -216,11 +216,11 @@ Follow [Get Started with Managed Resources]({{<ref "../get-started/get-started-w
|
||||||
to see how managed resources work.
|
to see how managed resources work.
|
||||||
|
|
||||||
{{<hint "note">}}
|
{{<hint "note">}}
|
||||||
Only AWS managed resources support the Crossplane v2 preview.
|
AWS managed resources fully support Crossplane v2.
|
||||||
|
|
||||||
<!-- vale gitlab.FutureTense = NO -->
|
<!-- vale gitlab.FutureTense = NO -->
|
||||||
Maintainers will update the managed resources for other systems including Azure,
|
Maintainers are actively working to update managed resources for other systems including Azure,
|
||||||
GCP, Terraform, Helm, GitHub, etc to support Crossplane v2 soon.
|
GCP, Terraform, Helm, GitHub, etc to support Crossplane v2.
|
||||||
<!-- vale gitlab.FutureTense = YES -->
|
<!-- vale gitlab.FutureTense = YES -->
|
||||||
{{</hint>}}
|
{{</hint>}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
title: What's New in v2?
|
title: What's New in v2?
|
||||||
weight: 4
|
weight: 4
|
||||||
description: Learn what's new in the Crossplane v2 preview
|
description: Learn what's new in Crossplane v2
|
||||||
---
|
---
|
||||||
**Crossplane v2 makes Crossplane more useful, more intuitive, and less
|
**Crossplane v2 makes Crossplane more useful, more intuitive, and less
|
||||||
opinionated.**
|
opinionated.**
|
||||||
|
|
@ -151,12 +151,11 @@ opinionated about using composition and MRs together. Namespaces enable fine
|
||||||
grained access control over who can create what MRs.
|
grained access control over who can create what MRs.
|
||||||
|
|
||||||
{{<hint "note">}}
|
{{<hint "note">}}
|
||||||
During the Crossplane v2 preview only namespaced AWS managed resources are
|
Namespaced AWS managed resources are fully available in Crossplane v2.
|
||||||
available.
|
|
||||||
|
|
||||||
<!-- vale gitlab.FutureTense = NO -->
|
<!-- vale gitlab.FutureTense = NO -->
|
||||||
Maintainers will update the managed resources for other systems including Azure,
|
Maintainers are actively working to update managed resources for other systems including Azure,
|
||||||
GCP, Terraform, Helm, GitHub, etc to support namespaced MRs soon.
|
GCP, Terraform, Helm, GitHub, etc to support namespaced MRs.
|
||||||
<!-- vale gitlab.FutureTense = YES -->
|
<!-- vale gitlab.FutureTense = YES -->
|
||||||
{{</hint>}}
|
{{</hint>}}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue