Skip to content

Commit

Permalink
ESO
Browse files Browse the repository at this point in the history
  • Loading branch information
vfarcic committed Jan 19, 2024
1 parent 5f9fa71 commit 349c443
Show file tree
Hide file tree
Showing 26 changed files with 717 additions and 48 deletions.
108 changes: 102 additions & 6 deletions package/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ spec:
apiVersion: gotemplating.fn.crossplane.io/v1beta1
inline:
template: |-
{{ if .observed.composite.resource.spec.parameters.apps.crossplane }}
{{ if .observed.composite.resource.spec.parameters.apps.crossplane.enabled }}
---
apiVersion: helm.crossplane.io/v1beta1
kind: Release
Expand Down Expand Up @@ -757,7 +757,7 @@ spec:
apiVersion: gotemplating.fn.crossplane.io/v1beta1
inline:
template: |-
{{ if .observed.composite.resource.spec.parameters.apps.openfunction }}
{{ if .observed.composite.resource.spec.parameters.apps.openfunction.enabled }}
---
apiVersion: helm.crossplane.io/v1beta1
kind: Release
Expand All @@ -783,6 +783,38 @@ spec:
kind: GoTemplate
source: Inline
step: app-openfunction
- functionRef:
name: crossplane-contrib-function-go-templating
input:
apiVersion: gotemplating.fn.crossplane.io/v1beta1
inline:
template: |-
{{ if .observed.composite.resource.spec.parameters.apps.externalSecrets.enabled }}
---
apiVersion: helm.crossplane.io/v1beta1
kind: Release
metadata:
name: {{ $.observed.composite.resource.spec.id }}-app-external-secrets
annotations:
crossplane.io/external-name: external-secrets
gotemplating.fn.crossplane.io/composition-resource-name: {{ $.observed.composite.resource.spec.id }}-app-external-secrets
spec:
forProvider:
chart:
name: external-secrets
repository: https://charts.external-secrets.io
version: 0.9.11
set:
- name: installCRDs
value: "true"
namespace: external-secrets
rollbackLimit: 3
providerConfigRef:
name: {{ $.observed.composite.resource.spec.id }}
{{ end }}
kind: GoTemplate
source: Inline
step: app-external-secrets
- functionRef:
name: crossplane-contrib-function-go-templating
input:
Expand Down Expand Up @@ -1033,7 +1065,7 @@ spec:
apiVersion: gotemplating.fn.crossplane.io/v1beta1
inline:
template: |-
{{ if .observed.composite.resource.spec.parameters.apps.crossplane }}
{{ if .observed.composite.resource.spec.parameters.apps.crossplane.enabled }}
---
apiVersion: helm.crossplane.io/v1beta1
kind: Release
Expand Down Expand Up @@ -1062,7 +1094,7 @@ spec:
apiVersion: gotemplating.fn.crossplane.io/v1beta1
inline:
template: |-
{{ if .observed.composite.resource.spec.parameters.apps.openfunction }}
{{ if .observed.composite.resource.spec.parameters.apps.openfunction.enabled }}
---
apiVersion: helm.crossplane.io/v1beta1
kind: Release
Expand All @@ -1088,6 +1120,38 @@ spec:
kind: GoTemplate
source: Inline
step: app-openfunction
- functionRef:
name: crossplane-contrib-function-go-templating
input:
apiVersion: gotemplating.fn.crossplane.io/v1beta1
inline:
template: |-
{{ if .observed.composite.resource.spec.parameters.apps.externalSecrets.enabled }}
---
apiVersion: helm.crossplane.io/v1beta1
kind: Release
metadata:
name: {{ $.observed.composite.resource.spec.id }}-app-external-secrets
annotations:
crossplane.io/external-name: external-secrets
gotemplating.fn.crossplane.io/composition-resource-name: {{ $.observed.composite.resource.spec.id }}-app-external-secrets
spec:
forProvider:
chart:
name: external-secrets
repository: https://charts.external-secrets.io
version: 0.9.11
set:
- name: installCRDs
value: "true"
namespace: external-secrets
rollbackLimit: 3
providerConfigRef:
name: {{ $.observed.composite.resource.spec.id }}
{{ end }}
kind: GoTemplate
source: Inline
step: app-external-secrets
- functionRef:
name: crossplane-contrib-function-go-templating
input:
Expand Down Expand Up @@ -1322,7 +1386,7 @@ spec:
apiVersion: gotemplating.fn.crossplane.io/v1beta1
inline:
template: |-
{{ if .observed.composite.resource.spec.parameters.apps.crossplane }}
{{ if .observed.composite.resource.spec.parameters.apps.crossplane.enabled }}
---
apiVersion: helm.crossplane.io/v1beta1
kind: Release
Expand Down Expand Up @@ -1351,7 +1415,7 @@ spec:
apiVersion: gotemplating.fn.crossplane.io/v1beta1
inline:
template: |-
{{ if .observed.composite.resource.spec.parameters.apps.openfunction }}
{{ if .observed.composite.resource.spec.parameters.apps.openfunction.enabled }}
---
apiVersion: helm.crossplane.io/v1beta1
kind: Release
Expand All @@ -1377,6 +1441,38 @@ spec:
kind: GoTemplate
source: Inline
step: app-openfunction
- functionRef:
name: crossplane-contrib-function-go-templating
input:
apiVersion: gotemplating.fn.crossplane.io/v1beta1
inline:
template: |-
{{ if .observed.composite.resource.spec.parameters.apps.externalSecrets.enabled }}
---
apiVersion: helm.crossplane.io/v1beta1
kind: Release
metadata:
name: {{ $.observed.composite.resource.spec.id }}-app-external-secrets
annotations:
crossplane.io/external-name: external-secrets
gotemplating.fn.crossplane.io/composition-resource-name: {{ $.observed.composite.resource.spec.id }}-app-external-secrets
spec:
forProvider:
chart:
name: external-secrets
repository: https://charts.external-secrets.io
version: 0.9.11
set:
- name: installCRDs
value: "true"
namespace: external-secrets
rollbackLimit: 3
providerConfigRef:
name: {{ $.observed.composite.resource.spec.id }}
{{ end }}
kind: GoTemplate
source: Inline
step: app-external-secrets
- functionRef:
name: crossplane-contrib-function-go-templating
input:
Expand Down
21 changes: 17 additions & 4 deletions package/definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,26 @@ spec:
description: List of apps that should be installed in the cluster
properties:
crossplane:
type: object
description: Install Crossplane
type: boolean
default: false
properties:
enabled:
type: boolean
default: false
openfunction:
type: object
description: Install OpenFunction
type: boolean
default: false
properties:
enabled:
type: boolean
default: false
externalSecrets:
type: object
description: Install External Secrets Operator (ESO)
properties:
enabled:
type: boolean
default: false
required:
- nodeSize
required:
Expand Down
3 changes: 2 additions & 1 deletion tests/aws/02-apps-crossplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ spec:
nodeSize: medium
minNodeCount: 3
apps:
crossplane: true
crossplane:
enabled: true
3 changes: 3 additions & 0 deletions tests/aws/02-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ spec:
parameters:
minNodeCount: 3
nodeSize: medium
apps:
crossplane:
enabled: true
resourceRefs:
- apiVersion: ec2.aws.upbound.io/v1beta1
kind: InternetGateway
Expand Down
6 changes: 4 additions & 2 deletions tests/aws/03-apps-openfunction.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ spec:
nodeSize: medium
minNodeCount: 3
apps:
crossplane: true
openfunction: true
crossplane:
enabled: true
openfunction:
enabled: true
12 changes: 8 additions & 4 deletions tests/aws/03-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ spec:
minNodeCount: 3
nodeSize: medium
apps:
crossplane: true
openfunction: true
crossplane:
enabled: true
openfunction:
enabled: true
resourceRef:
apiVersion: devopstoolkitseries.com/v1alpha1
kind: CompositeCluster
Expand All @@ -42,8 +44,10 @@ spec:
minNodeCount: 3
nodeSize: medium
apps:
crossplane: true
openfunction: true
crossplane:
enabled: true
openfunction:
enabled: true
resourceRefs:
- apiVersion: ec2.aws.upbound.io/v1beta1
kind: InternetGateway
Expand Down
21 changes: 21 additions & 0 deletions tests/aws/04-apps-eso.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
apiVersion: devopstoolkitseries.com/v1alpha1
kind: ClusterClaim
metadata:
name: a-team-eks
spec:
id: a-team-eks
compositionSelector:
matchLabels:
provider: aws
cluster: eks
parameters:
nodeSize: medium
minNodeCount: 3
apps:
crossplane:
enabled: true
openfunction:
enabled: true
externalSecrets:
enabled: true
Loading

0 comments on commit 349c443

Please sign in to comment.