-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from vshn/redis
redis composition
- Loading branch information
Showing
31 changed files
with
1,505 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,6 @@ | |
# Kubebuilder | ||
/apis/generated/ | ||
/apis/**/zz_generated.deepcopy.go | ||
|
||
# jsonnet builder | ||
component/jsonnetfile.json |
13 changes: 13 additions & 0 deletions
13
docs/modules/ROOT/pages/references/composition/dbaas/exoscale/redis.adoc
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
= pkg.appcat.composition.dbaas.exoscale.redis | ||
|
||
The parent key for all of the following parameters is `pkg.appcat.composition.dbaas.exoscale.redis`. | ||
|
||
== `secretNamespaces:redis` | ||
|
||
[horizontal] | ||
type:: string | ||
default:: `provider-exoscale-secrets-redis` | ||
|
||
The namespace where the provider-exoscale stores intermediate credential `Secrets` for `Redis` resources. | ||
The idea is to have them in their own namespace so that they don't clutter any other namespace. | ||
In the composition the `Secrets` are being used for accessing redis databases on exoscale.com. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
classes: | ||
- .common | ||
|
||
parameters: | ||
pkg.appcat.composition.dbaas.exoscale: | ||
secretNamespaces: | ||
redis: syn-provider-exoscale-secrets | ||
|
||
appcat: | ||
compositions: | ||
"exoscale.redis.appcat.vshn.io": | ||
commonPatchSets: | ||
annotations: {} | ||
labels: {} | ||
commonResources: | ||
observeClaimNamespace: {} | ||
spec: | ||
compositeTypeRef: | ||
apiVersion: appcat.vshn.io/v1 | ||
kind: XExoscaleRedis | ||
writeConnectionSecretsToNamespace: ${crossplane:namespace} | ||
resources: | ||
|
||
- base: | ||
apiVersion: exoscale.crossplane.io/v1 | ||
kind: Redis | ||
metadata: {} # patched | ||
spec: | ||
forProvider: | ||
ipFilter: "" # patched | ||
maintenance: | ||
dayOfWeek: "" # patched | ||
timeOfDay: "" # patched | ||
redisSettings: {} # patched | ||
size: | ||
plan: "" # patched | ||
zone: "" # patched | ||
terminationProtection: false | ||
writeConnectionSecretToRef: | ||
name: "" # patched | ||
namespace: ${pkg.appcat.composition.dbaas.exoscale:secretNamespaces:redis} | ||
providerConfigRef: | ||
name: exoscale-dbaas | ||
connectionDetails: | ||
- fromConnectionSecretKey: REDIS_HOST | ||
type: FromConnectionSecretKey | ||
name: REDIS_HOST | ||
- fromConnectionSecretKey: REDIS_PORT | ||
type: FromConnectionSecretKey | ||
name: REDIS_PORT | ||
- fromConnectionSecretKey: REDIS_USERNAME | ||
type: FromConnectionSecretKey | ||
name: REDIS_USERNAME | ||
- fromConnectionSecretKey: REDIS_PASSWORD | ||
type: FromConnectionSecretKey | ||
name: REDIS_PASSWORD | ||
- fromConnectionSecretKey: REDIS_URL | ||
type: FromConnectionSecretKey | ||
name: REDIS_URL | ||
- fromConnectionSecretKey: ca.crt | ||
type: FromConnectionSecretKey | ||
name: ca.crt | ||
patches: | ||
- type: PatchSet | ||
patchSetName: annotations | ||
- type: PatchSet | ||
patchSetName: labels | ||
- type: FromCompositeFieldPath | ||
fromFieldPath: metadata.labels[crossplane.io/composite] | ||
toFieldPath: metadata.name | ||
- type: FromCompositeFieldPath | ||
fromFieldPath: metadata.labels[crossplane.io/composite] | ||
toFieldPath: spec.writeConnectionSecretToRef.name | ||
# Set redis settings | ||
- type: FromCompositeFieldPath | ||
fromFieldPath: spec.parameters.service.redisSettings | ||
toFieldPath: spec.forProvider.redisSettings | ||
# Set zone | ||
- type: FromCompositeFieldPath | ||
fromFieldPath: spec.parameters.service.zone | ||
toFieldPath: spec.forProvider.zone | ||
# Set IP filter | ||
- type: FromCompositeFieldPath | ||
fromFieldPath: spec.parameters.network.ipFilter | ||
toFieldPath: spec.forProvider.ipFilter | ||
# Set exoscale plan | ||
- type: FromCompositeFieldPath | ||
fromFieldPath: spec.parameters.size.plan | ||
toFieldPath: spec.forProvider.size.plan | ||
# Set maintenance day of week | ||
- type: FromCompositeFieldPath | ||
fromFieldPath: spec.parameters.maintenance.dayOfWeek | ||
toFieldPath: spec.forProvider.maintenance.dayOfWeek | ||
# Set maintenance timeOfDay | ||
- type: FromCompositeFieldPath | ||
fromFieldPath: spec.parameters.maintenance.timeOfDay | ||
toFieldPath: spec.forProvider.maintenance.timeOfDay | ||
|
||
additionalResources: | ||
provider-exoscale-secrets-redis: | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: ${pkg.appcat.composition.dbaas.exoscale:secretNamespaces:redis} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
classes: | ||
- ..composition.dbaas.exoscale.redis | ||
# composition requires provider-kubernetes as dependency | ||
- ..provider.kubernetes | ||
|
||
parameters: | ||
crossplane: | ||
# This is not resolving during "commodore package compile", so we provide it explicitly | ||
namespace: syn-crossplane |
7 changes: 7 additions & 0 deletions
7
...ages/tests/golden/composition-dbaas-redis-exoscale/appcat/appcat/additionalResources.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
annotations: {} | ||
labels: | ||
name: syn-provider-exoscale-secrets | ||
name: syn-provider-exoscale-secrets |
122 changes: 122 additions & 0 deletions
122
packages/tests/golden/composition-dbaas-redis-exoscale/appcat/appcat/compositions.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
apiVersion: apiextensions.crossplane.io/v1 | ||
kind: Composition | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
argocd.argoproj.io/sync-wave: '10' | ||
labels: | ||
name: exoscale.redis.appcat.vshn.io | ||
name: exoscale.redis.appcat.vshn.io | ||
spec: | ||
compositeTypeRef: | ||
apiVersion: appcat.vshn.io/v1 | ||
kind: XExoscaleRedis | ||
patchSets: | ||
- name: annotations | ||
patches: | ||
- fromFieldPath: metadata.annotations | ||
toFieldPath: metadata.annotations | ||
type: FromCompositeFieldPath | ||
- name: labels | ||
patches: | ||
- fromFieldPath: metadata.labels | ||
toFieldPath: metadata.labels | ||
type: FromCompositeFieldPath | ||
resources: | ||
- base: | ||
apiVersion: exoscale.crossplane.io/v1 | ||
kind: Redis | ||
metadata: {} | ||
spec: | ||
forProvider: | ||
ipFilter: '' | ||
maintenance: | ||
dayOfWeek: '' | ||
timeOfDay: '' | ||
redisSettings: {} | ||
size: | ||
plan: '' | ||
terminationProtection: false | ||
zone: '' | ||
providerConfigRef: | ||
name: exoscale-dbaas | ||
writeConnectionSecretToRef: | ||
name: '' | ||
namespace: syn-provider-exoscale-secrets | ||
connectionDetails: | ||
- fromConnectionSecretKey: REDIS_HOST | ||
name: REDIS_HOST | ||
type: FromConnectionSecretKey | ||
- fromConnectionSecretKey: REDIS_PORT | ||
name: REDIS_PORT | ||
type: FromConnectionSecretKey | ||
- fromConnectionSecretKey: REDIS_USERNAME | ||
name: REDIS_USERNAME | ||
type: FromConnectionSecretKey | ||
- fromConnectionSecretKey: REDIS_PASSWORD | ||
name: REDIS_PASSWORD | ||
type: FromConnectionSecretKey | ||
- fromConnectionSecretKey: REDIS_URL | ||
name: REDIS_URL | ||
type: FromConnectionSecretKey | ||
- fromConnectionSecretKey: ca.crt | ||
name: ca.crt | ||
type: FromConnectionSecretKey | ||
patches: | ||
- patchSetName: annotations | ||
type: PatchSet | ||
- patchSetName: labels | ||
type: PatchSet | ||
- fromFieldPath: metadata.labels[crossplane.io/composite] | ||
toFieldPath: metadata.name | ||
type: FromCompositeFieldPath | ||
- fromFieldPath: metadata.labels[crossplane.io/composite] | ||
toFieldPath: spec.writeConnectionSecretToRef.name | ||
type: FromCompositeFieldPath | ||
- fromFieldPath: spec.parameters.service.redisSettings | ||
toFieldPath: spec.forProvider.redisSettings | ||
type: FromCompositeFieldPath | ||
- fromFieldPath: spec.parameters.service.zone | ||
toFieldPath: spec.forProvider.zone | ||
type: FromCompositeFieldPath | ||
- fromFieldPath: spec.parameters.network.ipFilter | ||
toFieldPath: spec.forProvider.ipFilter | ||
type: FromCompositeFieldPath | ||
- fromFieldPath: spec.parameters.size.plan | ||
toFieldPath: spec.forProvider.size.plan | ||
type: FromCompositeFieldPath | ||
- fromFieldPath: spec.parameters.maintenance.dayOfWeek | ||
toFieldPath: spec.forProvider.maintenance.dayOfWeek | ||
type: FromCompositeFieldPath | ||
- fromFieldPath: spec.parameters.maintenance.timeOfDay | ||
toFieldPath: spec.forProvider.maintenance.timeOfDay | ||
type: FromCompositeFieldPath | ||
- base: | ||
apiVersion: kubernetes.crossplane.io/v1alpha1 | ||
kind: Object | ||
spec: | ||
forProvider: | ||
manifest: | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: '' | ||
managementPolicy: Observe | ||
providerConfigRef: | ||
name: kubernetes | ||
patches: | ||
- fromFieldPath: metadata.labels[crossplane.io/claim-namespace] | ||
toFieldPath: spec.forProvider.manifest.metadata.name | ||
type: FromCompositeFieldPath | ||
- fromFieldPath: status.atProvider.manifest.metadata.labels[appuio.io/organization] | ||
toFieldPath: metadata.labels[appuio.io/organization] | ||
type: ToCompositeFieldPath | ||
- fromFieldPath: metadata.labels[crossplane.io/composite] | ||
toFieldPath: metadata.name | ||
transforms: | ||
- string: | ||
fmt: '%s-ns-observer' | ||
type: Format | ||
type: string | ||
type: FromCompositeFieldPath | ||
writeConnectionSecretsToNamespace: syn-crossplane |
Empty file.
7 changes: 7 additions & 0 deletions
7
packages/tests/golden/composition-dbaas-redis-exoscale/crossplane/apps/crossplane.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
spec: | ||
ignoreDifferences: | ||
- group: rbac.authorization.k8s.io | ||
jsonPointers: | ||
- /rules | ||
kind: ClusterRole | ||
name: crossplane |
7 changes: 7 additions & 0 deletions
7
...ges/tests/golden/composition-dbaas-redis-exoscale/crossplane/crossplane/00_namespace.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
annotations: {} | ||
labels: | ||
name: syn-crossplane | ||
name: syn-crossplane |
Oops, something went wrong.