You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/master/composition/composition-revisions.md
+30-28Lines changed: 30 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,10 +16,10 @@ database configuration of an Azure MySQL Server and some firewall rules. The
16
16
`Composition` contains the 'base' configuration for the MySQL server and the
17
17
firewall rules that the `PlatformDB` configuration extends.
18
18
19
-
A `Composition` associates with multiple XRs that use it. You might
20
-
define a `Composition` named `big-platform-db` that's used by ten different
21
-
`PlatformDB` XRs. Often, in the interest of self-service, a different team manages the `Composition`
22
-
than the actual `PlatformDB` XRs. For example
19
+
A `Composition` associates with multiple XRs that use it. You might
20
+
define a `Composition` named `big-platform-db` that's used by ten different
21
+
`PlatformDB` XRs. Often, in the interest of self-service, a different team manages the `Composition`
22
+
than the actual `PlatformDB` XRs. For example
23
23
a platform team member may write and maintain the `Composition`,
24
24
while individual app teams create `PlatformDB` XRs that use said
25
25
`Composition`.
@@ -88,6 +88,7 @@ manually update it when you wish it to use another `CompositionRevision`.
88
88
apiVersion: example.org/v1alpha1
89
89
kind: PlatformDB
90
90
metadata:
91
+
namespace: default
91
92
name: example
92
93
spec:
93
94
storageGB: 20
@@ -108,6 +109,7 @@ use a different `CompositionRevision`.
108
109
apiVersion: example.org/v1alpha1
109
110
kind: PlatformDB
110
111
metadata:
112
+
namespace: default
111
113
name: example
112
114
spec:
113
115
storageGB: 20
@@ -125,9 +127,9 @@ spec:
125
127
This tutorial discusses how CompositionRevisions work and how they manage Composite Resource
126
128
(XR) updates. This starts with a `Composition` and `CompositeResourceDefinition` (XRD) that defines a `MyVPC`
127
129
resource and continues with creating multiple XRs to observe different upgrade paths. Crossplane
128
-
assigns different CompositionRevisions to composite resources each time you update the composition.
130
+
assigns different CompositionRevisions to composite resources each time you update the composition.
129
131
130
-
### Preparation
132
+
### Preparation
131
133
132
134
#### Deploy composition and XRD examples
133
135
Apply the example Composition.
@@ -177,18 +179,18 @@ spec:
177
179
plural: myvpcs
178
180
versions:
179
181
- name: v1alpha1
180
-
served: true
181
-
referenceable: true
182
+
served: true
183
+
referenceable: true
182
184
schema:
183
185
openAPIV3Schema:
184
-
type: object
186
+
type: object
185
187
properties:
186
188
spec:
187
-
type: object
189
+
type: object
188
190
properties:
189
191
id:
190
-
type: string
191
-
description: ID of this VPC that other objects will use to refer to it.
192
+
type: string
193
+
description: ID of this VPC that other objects will use to refer to it.
192
194
required:
193
195
- id
194
196
```
@@ -228,7 +230,7 @@ spec:
228
230
Expected Output:
229
231
```shell
230
232
myvpc.aws.example.upbound.io/vpc-auto created
231
-
```
233
+
```
232
234
233
235
#### Manual update policy
234
236
Create a Composite Resource with `compositionUpdatePolicy: Manual` and `compositionRevisionRef`.
@@ -249,7 +251,7 @@ spec:
249
251
Expected Output:
250
252
```shell
251
253
myvpc.aws.example.upbound.io/vpc-man created
252
-
```
254
+
```
253
255
254
256
#### Using a selector
255
257
Create an XR with a `compositionRevisionSelector` of `channel: dev`:
@@ -269,7 +271,7 @@ spec:
269
271
Expected Output:
270
272
```shell
271
273
myvpc.aws.example.upbound.io/vpc-dev created
272
-
```
274
+
```
273
275
274
276
Create an XR with a `compositionRevisionSelector` of `channel: staging`:
275
277
```yaml
@@ -289,9 +291,9 @@ spec:
289
291
Expected Output:
290
292
```shell
291
293
myvpc.aws.example.upbound.io/vpc-staging created
292
-
```
294
+
```
293
295
294
-
Verify the Composite Resource with the label `channel: staging` doesn't have a `REVISION`.
296
+
Verify the Composite Resource with the label `channel: staging` doesn't have a `REVISION`.
295
297
All other XRs have a `REVISION` matching the created Composition Revision.
296
298
```shell
297
299
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"
0 commit comments