Skip to content

Commit 511b010

Browse files
authored
updated to crossplane v2 (#92)
Updated configuration to Crossplane 2.0.
1 parent 44e00b4 commit 511b010

File tree

23 files changed

+179
-192
lines changed

23 files changed

+179
-192
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ In this specific configuration, the API contains:
1414

1515
- **an [AWS Database](/apis/definition.yaml) custom resource type.**
1616
- **Composition:** Configured in [/apis/composition.yaml](/apis/composition.yaml)
17-
- **Embedded Function:** The Composition logic is encapsulated within [embedded function](/functions/xsqlinstance/main.k)
17+
- **Embedded Function:** The Composition logic is encapsulated within [embedded function](/functions/sqlinstance/main.k)
1818

1919
## Testing
2020

apis/.gitkeep

Whitespace-only changes.
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
apiVersion: apiextensions.crossplane.io/v1
22
kind: Composition
33
metadata:
4-
labels:
5-
provider: aws
6-
name: xsqlinstances.aws.platform.upbound.io
4+
name: sqlinstances.aws.platform.upbound.io
75
spec:
86
compositeTypeRef:
97
apiVersion: aws.platform.upbound.io/v1alpha1
10-
kind: XSQLInstance
8+
kind: SQLInstance
119
mode: Pipeline
1210
pipeline:
1311
- functionRef:
14-
name: upbound-configuration-aws-databasexsqlinstance
15-
step: xsqlinstance
12+
name: upbound-configuration-aws-databasesqlinstance
13+
step: sqlinstance
1614
- functionRef:
1715
name: crossplane-contrib-function-auto-ready
1816
step: crossplane-contrib-function-auto-ready
19-
writeConnectionSecretsToNamespace: upbound-system

apis/definition.yaml renamed to apis/sqlinstances/definition.yaml

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
1-
apiVersion: apiextensions.crossplane.io/v1
1+
apiVersion: apiextensions.crossplane.io/v2
22
kind: CompositeResourceDefinition
33
metadata:
4-
name: xsqlinstances.aws.platform.upbound.io
4+
name: sqlinstances.aws.platform.upbound.io
55
spec:
6-
claimNames:
7-
kind: SQLInstance
8-
plural: sqlinstances
9-
connectionSecretKeys:
10-
- username
11-
- password
12-
- endpoint
13-
- host
146
group: aws.platform.upbound.io
157
names:
16-
kind: XSQLInstance
17-
plural: xsqlinstances
8+
categories:
9+
- crossplane
10+
kind: SQLInstance
11+
plural: sqlinstances
12+
scope: Namespaced
1813
versions:
19-
- name: v1alpha1
20-
served: true
21-
referenceable: true
22-
schema:
23-
openAPIV3Schema:
14+
- name: v1alpha1
15+
served: true
16+
referenceable: true
17+
schema:
18+
openAPIV3Schema:
2419
type: object
2520
properties:
2621
spec:
@@ -32,13 +27,19 @@ spec:
3227
region:
3328
type: string
3429
description: Region is the region you'd like your resource to be created in.
35-
deletionPolicy:
36-
description: Delete the external resources when the Claim/XR is deleted. Defaults to Delete
37-
enum:
38-
- Delete
39-
- Orphan
40-
type: string
41-
default: Delete
30+
managementPolicies:
31+
description: ManagementPolicies for AWS EC2 resources. Defaults to ["*"] which includes all operations (Create, Observe, Update, Delete, LateInitialize). To orphan resources on deletion, use ["Create", "Observe", "Update", "LateInitialize"].
32+
type: array
33+
items:
34+
type: string
35+
enum:
36+
- "*"
37+
- Create
38+
- Observe
39+
- Update
40+
- Delete
41+
- LateInitialize
42+
default: "*"
4243
providerConfigName:
4344
description: Crossplane ProviderConfig to use for provisioning this resources
4445
type: string
@@ -58,14 +59,11 @@ spec:
5859
type: object
5960
description: "A reference to the Secret object containing database password"
6061
properties:
61-
namespace:
62-
type: string
6362
name:
6463
type: string
6564
key:
6665
type: string
6766
required:
68-
- namespace
6967
- name
7068
- key
7169
autoGeneratePassword:

examples/.gitkeep

Whitespace-only changes.
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
apiVersion: aws.platform.upbound.io/v1alpha1
2-
kind: XSQLInstance
2+
kind: SQLInstance
33
metadata:
44
name: configuration-aws-database-mariadb
55
namespace: default
66
spec:
77
parameters:
88
region: us-west-2
99
engine: mariadb
10-
engineVersion: "10.11.6"
10+
engineVersion: "11.8.3"
1111
storageGB: 5
1212
autoGeneratePassword: true
1313
passwordSecretRef:
14-
namespace: default
1514
name: mariadbsecret
1615
key: password
1716
networkRef:
18-
id: configuration-aws-database
19-
writeConnectionSecretToRef:
20-
name: configuration-aws-database-mariadb
21-
namespace: default
17+
id: configuration-aws-database

examples/network.yaml renamed to examples/sqlinstance/network.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
apiVersion: aws.platform.upbound.io/v1alpha1
2-
kind: XNetwork
2+
kind: Network
33
metadata:
44
name: configuration-aws-database
5+
namespace: default
56
spec:
67
parameters:
78
id: configuration-aws-database

examples/postgres-xr.yaml renamed to examples/sqlinstance/postgres-xr.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: aws.platform.upbound.io/v1alpha1
2-
kind: XSQLInstance
2+
kind: SQLInstance
33
metadata:
44
name: configuration-aws-database-postgres
55
namespace: default
@@ -10,14 +10,10 @@ spec:
1010
engineVersion: "13.18"
1111
storageGB: 5
1212
passwordSecretRef:
13-
namespace: default
1413
name: psqlsecret
1514
key: password
1615
networkRef:
1716
id: configuration-aws-database
18-
writeConnectionSecretToRef:
19-
name: configuration-aws-database-postgres
20-
namespace: default
2117
---
2218
apiVersion: v1
2319
data:

functions/.gitkeep

Whitespace-only changes.

functions/xsqlinstance/kcl.mod renamed to functions/sqlinstance/kcl.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "xsqlinstance"
2+
name = "sqlinstance"
33
version = "0.0.1"
44

55
[dependencies]

0 commit comments

Comments
 (0)