Skip to content

Instantly share code, notes, and snippets.

@jbw976
Last active April 21, 2023 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbw976/e9fcab598e0a02096487804d48f595ad to your computer and use it in GitHub Desktop.
Save jbw976/e9fcab598e0a02096487804d48f595ad to your computer and use it in GitHub Desktop.
Composition Function examples for Crossplane Intro/Deep-dive
apiVersion: database.example.org/v1alpha1
kind: AcmeCoDatabase
metadata:
name: example-db
spec:
parameters:
storageGB: 20
compositionRef:
name: example
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