Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pbateman committed Jun 23, 2022
1 parent 83fe64d commit aff0652
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 54 deletions.
50 changes: 50 additions & 0 deletions example_app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: django
labels:
foo: "bar"

---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: django
name: django
labels:
app: django
spec:
replicas: 1
selector:
matchLabels:
app: django
template:
metadata:
labels:
app: django
spec:
containers:
- name: django
image: strm/helloworld-http
ports:
- containerPort: 8000

---
apiVersion: v1
kind: Service
metadata:
name: django
namespace: django
spec:
selector:
app: django
ports:
- protocol: TCP
port: 80
targetPort: 8000





59 changes: 10 additions & 49 deletions example_composition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,6 @@ spec:
fromFieldPath: spec.resourceConfig.namespace
toFieldPath: spec.forProvider.manifest.metadata.namespace
resources:
- base:
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: Object
metadata:
name: django-deployment
spec:
forProvider:
manifest:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: django
spec:
replicas: 1
selector:
matchLabels:
app: django
template:
metadata:
labels:
app: django
spec:
containers:
- name: django
image: strm/helloworld-http
ports:
- containerPort: 8000
patches:
- type: PatchSet
patchSetName: common-fields

- base:
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: Object
Expand Down Expand Up @@ -84,13 +52,13 @@ spec:
toFieldPath: spec.forProvider.manifest.spec.defaultBackend.service.port.number
- type: ToCompositeFieldPath
fromFieldPath: status.atProvider.manifest.status.loadBalancer.ingress.hostname
toFieldpath: compositeFields.ingress.hostname
toFieldPath: metadata.annotations.ingress.hostname

- base:
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: Object
apiVersion: route53.aws.crossplane.io/v1alpha1
kind: ResourceRecordSet
metadata:
name: django-r53
name: foobar.testingtesting123.com
spec:
references:
- patchesFrom:
Expand All @@ -101,25 +69,18 @@ spec:
fieldPath: status.loadBalancer.ingress.hostname
toFieldPath: spec.forProvider.dnsName
forProvider:
manifest:
apiVersion: route53.aws.crossplane.io/v1alpha1
kind: ResourceRecordSet
metadata:
name: foobar.testingtesting123.com
spec:
forProvider:
aliasTarget:
evaluateTargetHealth: false
type: A
aliasTarget:
evaluateTargetHealth: false
type: A
patches:
- type: PatchSet
patchSetName: common-fields
- type: FromCompositeFieldPath
fromFieldPath: spec.resourceConfig.hostedZoneId
toFieldPath: spec.forProvider.manifest.spec.forProvider.aliasTarget.hostedZoneId
toFieldPath: spec.forProvider.aliasTarget.hostedZoneId
- type: FromCompositeFieldPath
fromFieldPath: spec.resourceConfig.zoneId
toFieldPath: spec.forProvider.manifest.spec.forProvider.zoneId
- type: FromCompositeFieldPath
fromFieldPath: compositeFields.ingress.hostname
toFieldPath: spec.forProvider.manifest.spec.forProvider.aliasTarget.dnsName
fromFieldPath: metadata.annotations.ingress.hostname
toFieldPath: spec.forProvider.aliasTarget.dnsName
1 change: 0 additions & 1 deletion example_composition_claim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ metadata:
spec:
resourceConfig:
providerConfigName: default
region: ap-southeast-2
tags:
- key: foo
value: bar
Expand Down
4 changes: 0 additions & 4 deletions example_composition_definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ spec:
type: string
providerConfigName:
type: string
region:
description: The aws region to make resources in, eg ap-southeast-2
type: string
tags:
items:
properties:
Expand All @@ -60,7 +57,6 @@ spec:
type: array
required:
- providerConfigName
- region
- tags
type: object
required:
Expand Down

0 comments on commit aff0652

Please sign in to comment.