Last active
April 21, 2023 06:44
-
-
Save jbw976/e9fcab598e0a02096487804d48f595ad to your computer and use it in GitHub Desktop.
Composition Function examples for Crossplane Intro/Deep-dive
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: database.example.org/v1alpha1 | |
kind: AcmeCoDatabase | |
metadata: | |
name: example-db | |
spec: | |
parameters: | |
storageGB: 20 | |
compositionRef: | |
name: example |
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/v1 | |
kind: Composition | |
metadata: | |
name: example | |
spec: | |
compositeTyepRef: | |
apiVersion: database.example.org/v1alpha1 | |
kind: AcmeCoDatabase | |
resources: | |
- name: cloudsqlinstance | |
base: | |
apiVersion: database.gcp.crossplane.io/v1beta1 | |
kind: CloudSQLInstance | |
spec: | |
forProvider: | |
databaseVersion: POSTGRES_9_6 | |
region: us-central1 | |
settings: | |
tier: db-custom-1-3840 | |
patches: | |
- type: | |
fromFieldPath: spec.paramaters.storageGB | |
toFieldPath: spec.forProvider.settings.dataDiskSizeMb | |
transforms: | |
-type: math | |
math: | |
multiply: 1024 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment