Skip to content

Commit 44bd0de

Browse files
committedJul 1, 2024··
Update to a Claims based flow
Signed-off-by: Jared Watts <[email protected]>
1 parent 80f968f commit 44bd0de

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed
 

‎README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ kubectl apply -f composition.yaml
5252

5353
Now we are ready to create a compute instance:
5454
```
55-
kubectl apply -f xr.yaml
55+
kubectl apply -f claim.yaml
5656
```
5757

5858
Since we have provided an old non-current generation instance type, we expect the function to return an error and refuse to create the instance:
@@ -63,11 +63,11 @@ kubectl describe compute.example.crossplane.io/dev-instance
6363

6464
Let's update the instance type to a value that is current generation (`t3.micro`) and try again:
6565
```
66-
# edit xr.yaml to change instanceType to t3.micro, then:
67-
kubectl apply -f xr.yaml
66+
# edit claim.yaml to change instanceType to t3.micro, then:
67+
kubectl apply -f claim.yaml
6868
```
6969

70-
Now we should be using a current generation instance type, let's examine the XR again:
70+
Now we should be using a current generation instance type, let's examine the claim again:
7171
```
7272
crossplane beta trace compute.example.crossplane.io/dev-instance -o wide
7373
```
@@ -86,9 +86,9 @@ Now we have seen how to use credentials/secrets in your composition functions!
8686

8787
## Clean-up
8888

89-
Make sure to clean-up the EC2 instance by deleting the XR:
89+
Make sure to clean-up the EC2 instance by deleting the claim:
9090
```
91-
kubectl delete -f xr.yaml
91+
kubectl delete -f claim.yaml
9292
kubectl get instance.ec2
9393
```
9494

‎example/claim.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: example.crossplane.io/v1alpha1
2+
kind: Compute
3+
metadata:
4+
name: dev-instance
5+
spec:
6+
instanceType: t1.micro

‎example/composition.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
spec:
66
compositeTypeRef:
77
apiVersion: example.crossplane.io/v1alpha1
8-
kind: Compute
8+
kind: XCompute
99
mode: Pipeline
1010
pipeline:
1111
- step: create-resources

‎example/definition.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
apiVersion: apiextensions.crossplane.io/v1
22
kind: CompositeResourceDefinition
33
metadata:
4-
name: computes.example.crossplane.io
4+
name: xcomputes.example.crossplane.io
55
spec:
66
group: example.crossplane.io
77
names:
8+
kind: XCompute
9+
plural: xcomputes
10+
claimNames:
811
kind: Compute
912
plural: computes
1013
versions:

‎example/xr.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: example.crossplane.io/v1alpha1
2-
kind: Compute
2+
kind: XCompute
33
metadata:
44
name: dev-instance
55
spec:

0 commit comments

Comments
 (0)
Please sign in to comment.