chore(work): add Crossplane examples
This commit is contained in:
parent
c3edbddce8
commit
31a9a4ce92
10 changed files with 375 additions and 0 deletions
|
|
@ -0,0 +1,41 @@
|
|||
apiVersion: cognitoidp.aws.upbound.io/v1beta2
|
||||
kind: UserPool
|
||||
metadata:
|
||||
annotations:
|
||||
meta.upbound.io/example-id: cognitoidp/v1beta1/useringroup
|
||||
labels:
|
||||
testing.upbound.io/example-name: example
|
||||
name: example
|
||||
spec:
|
||||
forProvider:
|
||||
name: example
|
||||
region: us-east-1
|
||||
# userPoolTier: LITE
|
||||
providerConfigRef:
|
||||
name: cognito
|
||||
|
||||
---
|
||||
apiVersion: cognitoidp.aws.upbound.io/v1beta1
|
||||
kind: UserGroup
|
||||
metadata:
|
||||
annotations:
|
||||
meta.upbound.io/example-id: cognitoidp/v1beta1/usergroup
|
||||
labels:
|
||||
testing.upbound.io/example-name: example
|
||||
name: example
|
||||
spec:
|
||||
forProvider:
|
||||
name: example
|
||||
precedence: 42
|
||||
region: us-east-1
|
||||
# roleArnSelector:
|
||||
# matchLabels:
|
||||
# testing.upbound.io/example-name: group_role
|
||||
userPoolIdSelector:
|
||||
matchLabels:
|
||||
testing.upbound.io/example-name: example
|
||||
providerConfigRef:
|
||||
name: cognito
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
apiVersion: apiextensions.crossplane.io/v1
|
||||
kind: Composition
|
||||
metadata:
|
||||
name: xexamples.aws.k8s.masos.dev
|
||||
labels:
|
||||
provider: aws
|
||||
spec:
|
||||
writeConnectionSecretsToNamespace: crossplane-system
|
||||
compositeTypeRef:
|
||||
apiVersion: k8s.masos.dev/v1alpha1
|
||||
kind: XExample
|
||||
|
||||
patchSets:
|
||||
- name: example-id
|
||||
patches:
|
||||
- type: CombineFromComposite
|
||||
combine:
|
||||
variables:
|
||||
- fromFieldPath: spec.name
|
||||
- fromFieldPath: spec.tenant
|
||||
strategy: string
|
||||
string:
|
||||
fmt: "%s-%s"
|
||||
fromFieldPath: spec.id
|
||||
toFieldPath: metadata.labels[aws.k8s.masos.dev/example-id]
|
||||
- type: ToCompositeFieldPath
|
||||
fromFieldPath: metadata.labels[aws.k8s.masos.dev/example-id]
|
||||
toFieldPath: status.masos.id
|
||||
- type: ToCompositeFieldPath
|
||||
fromFieldPath: metadata.labels[aws.k8s.masos.dev/example-id]
|
||||
toFieldPath: status.masos-id
|
||||
|
||||
|
||||
|
||||
resources:
|
||||
- base:
|
||||
apiVersion: cognitoidp.aws.upbound.io/v1beta2
|
||||
kind: UserPool
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
deletionProtection: INACTIVE
|
||||
name: auth-backend
|
||||
patches:
|
||||
- type: PatchSet
|
||||
patchSetName: example-id
|
||||
- type: CombineFromComposite
|
||||
combine:
|
||||
variables:
|
||||
- fromFieldPath: spec.name
|
||||
- fromFieldPath: spec.tenant
|
||||
strategy: string
|
||||
string:
|
||||
fmt: "%s-%s"
|
||||
fromFieldPath: spec.id
|
||||
toFieldPath: spec.forProvider.name
|
||||
|
||||
- name: group-admin
|
||||
base:
|
||||
apiVersion: cognitoidp.aws.upbound.io/v1beta1
|
||||
kind: UserGroup
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: cognito
|
||||
forProvider:
|
||||
name: admin
|
||||
precedence: 10
|
||||
region: us-east-1
|
||||
# roleArnSelector:
|
||||
# matchLabels:
|
||||
# testing.upbound.io/example-name: group_role
|
||||
userPoolIdSelector:
|
||||
matchLabels:
|
||||
aws.k8s.masos.dev/example-id: unset
|
||||
patches:
|
||||
- type: PatchSet
|
||||
patchSetName: example-id
|
||||
- type: CombineFromComposite
|
||||
combine:
|
||||
variables:
|
||||
- fromFieldPath: spec.name
|
||||
- fromFieldPath: spec.tenant
|
||||
strategy: string
|
||||
string:
|
||||
fmt: "%s-%s"
|
||||
fromFieldPath: spec.id
|
||||
toFieldPath: spec.forProvider.userPoolIdSelector.matchLabels['aws.k8s.masos.dev/example-id']
|
||||
|
||||
- name: example-bucket
|
||||
base:
|
||||
apiVersion: cognitoidp.aws.upbound.io/v1beta1
|
||||
kind: UserGroup
|
||||
spec:
|
||||
providerConfigRef:
|
||||
name: s3
|
||||
forProvider:
|
||||
name: admin
|
||||
precedence: 10
|
||||
region: us-east-1
|
||||
# roleArnSelector:
|
||||
# matchLabels:
|
||||
# testing.upbound.io/example-name: group_role
|
||||
userPoolIdSelector:
|
||||
matchLabels:
|
||||
aws.k8s.masos.dev/example-id: unset
|
||||
patches:
|
||||
- type: PatchSet
|
||||
patchSetName: example-id
|
||||
- type: CombineFromComposite
|
||||
combine:
|
||||
variables:
|
||||
- fromFieldPath: spec.name
|
||||
- fromFieldPath: spec.tenant
|
||||
strategy: string
|
||||
string:
|
||||
fmt: "%s-%s"
|
||||
fromFieldPath: spec.id
|
||||
toFieldPath: spec.forProvider.userPoolIdSelector.matchLabels['aws.k8s.masos.dev/example-id']
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
apiVersion: apiextensions.crossplane.io/v1
|
||||
kind: CompositeResourceDefinition
|
||||
metadata:
|
||||
name: xexamples.k8s.masos.dev
|
||||
spec:
|
||||
group: k8s.masos.dev
|
||||
names:
|
||||
kind: XExample
|
||||
plural: xexamples
|
||||
claimNames:
|
||||
kind: Example
|
||||
plural: examples
|
||||
versions:
|
||||
- name: v1alpha1
|
||||
served: true
|
||||
referenceable: true
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
type: object
|
||||
properties:
|
||||
spec:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: ID of this resource that other objects will use to refer to it.
|
||||
tenant:
|
||||
type: string
|
||||
description: Tenant using this resource
|
||||
providerConfigRef:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
|
||||
required:
|
||||
- name
|
||||
- tenant
|
||||
|
||||
status:
|
||||
type: object
|
||||
properties:
|
||||
masos:
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
masos-id:
|
||||
type: string
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
apiVersion: k8s.masos.dev/v1alpha1
|
||||
kind: Example
|
||||
metadata:
|
||||
name: this-is-an-example
|
||||
namespace: default
|
||||
spec:
|
||||
name: alice
|
||||
tenant: wonderland
|
||||
17
bootstrap/crossplane/example-managed-resources/s3.test.yaml
Normal file
17
bootstrap/crossplane/example-managed-resources/s3.test.yaml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
apiVersion: s3.aws.upbound.io/v1beta2
|
||||
kind: Bucket
|
||||
metadata:
|
||||
annotations:
|
||||
meta.upbound.io/example-id: s3/v1beta2/bucket
|
||||
labels:
|
||||
testing.upbound.io/example-name: s3
|
||||
name: masos-crossplane-test
|
||||
spec:
|
||||
forProvider:
|
||||
objectLockEnabled: true
|
||||
region: us-east-1
|
||||
tags:
|
||||
example-tag: some-value
|
||||
|
||||
providerConfigRef:
|
||||
name: s3
|
||||
Loading…
Add table
Add a link
Reference in a new issue