Created
October 5, 2022 03:56
-
-
Save negz/c5a5b4f82b06882906b08af377a609a4 to your computer and use it in GitHub Desktop.
Crossplane Composition Functions IO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apiextensions.crossplane.io/v1alpha1 | |
| kind: FunctionIO | |
| # Optional arbitrary KRM-like resource. Each function in a pipeline will be | |
| # called with its own function config (i.e. config is not pipelined). | |
| config: | |
| apiVersion: database.example.org/v1alpha1 | |
| kind: Config | |
| metadata: | |
| name: cloudsql | |
| spec: | |
| version: POSTGRES_9_6 | |
| # The composite resource (including metadata, spec, and status) | |
| composite: | |
| apiVersion: database.example.org/v1alpha1 | |
| kind: XPostgreSQLInstance | |
| metadata: | |
| name: my-db | |
| spec: | |
| parameters: | |
| storageGB: 20 | |
| compositionSelector: | |
| matchLabels: | |
| provider: gcp | |
| writeConnectionSecretToRef: | |
| name: db-conn | |
| # TODO(negz): What if we just took the resources array of a Composition, | |
| # including patches etc? Is there value in that? Code could just ignore patches | |
| # and return fully formed bases if it wanted to. I like that this would make | |
| # the data structure identical to a Composition resources array, but is there | |
| # any other value? Would it be limiting to try to keep them identical? (Probably yes.) | |
| resources: | |
| - name: cloudsqlinstance | |
| base: | |
| apiVersion: database.gcp.crossplane.io/v1beta1 | |
| kind: CloudSQLInstance | |
| metadata: | |
| name: cloudsqlpostgresql | |
| spec: | |
| forProvider: | |
| databaseVersion: POSTGRES_9_6 | |
| region: us-central1 | |
| settings: | |
| tier: db-custom-1-3840 | |
| dataDiskType: PD_SSD | |
| dataDiskSizeGb: 20 | |
| writeConnectionSecretToRef: | |
| namespace: crossplane-system | |
| name: cloudsqlpostgresql-conn | |
| connectionDetails: | |
| - name: hostname | |
| fromConnectionSecretKey: hostname | |
| # TODO(negz): Do we want readiness checks too? Should the function be able to | |
| # write to the status of the XR directly to set a status? | |
| results: | |
| - severity: Error | |
| message: "Could not render Database.postgresql.crossplane.io/v1alpha1` |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@turkenh I ended up pushing a commit to crossplane/crossplane#2886 that adopts a stripped down version of the
FunctionIOAPI. I'd like to roll this conversation into that PR - I'll respond to your latest comment there. Thanks!