Skip to content

Commit

Permalink
Merge pull request #297 from vshn/fix/redis_connection_details
Browse files Browse the repository at this point in the history
Remove connection secret
  • Loading branch information
Kidswiss authored Jan 8, 2024
2 parents cf78294 + 10dd886 commit a115f6c
Show file tree
Hide file tree
Showing 37 changed files with 33 additions and 835 deletions.
2 changes: 1 addition & 1 deletion component/class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ parameters:
appcat:
registry: ghcr.io
repository: vshn/appcat
tag: v4.45.2
tag: v4.46.0
apiserver:
registry: ghcr.io
repository: vshn/appcat-apiserver
Expand Down
80 changes: 0 additions & 80 deletions component/component/vshn_redis.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -251,68 +251,6 @@ local composition =
},
},
};
local secret = comp.KubeObject('v1', 'Secret') +
{
spec+: {
forProvider+: {
manifest+: {
metadata: {},
stringData: {
REDIS_USERNAME: defaultUser,
REDIS_PORT: defaultPort,
REDIS_HOST: '',
},
},
},
references: [
{
patchesFrom: {
apiVersion: 'v1',
kind: 'Secret',
namespace: '',
name: 'redis',
fieldPath: 'data.redis-password',
},
toFieldPath: 'data.REDIS_PASSWORD',
},
{
patchesFrom: {
apiVersion: 'v1',
kind: 'Secret',
name: clientCertificateSecretName,
namespace: '',
fieldPath: 'data[ca.crt]',
},
toFieldPath: 'data[ca.crt]',
},
{
patchesFrom: {
apiVersion: 'v1',
kind: 'Secret',
name: clientCertificateSecretName,
namespace: '',
fieldPath: 'data[tls.crt]',
},
toFieldPath: 'data[tls.crt]',
},
{
patchesFrom: {
apiVersion: 'v1',
kind: 'Secret',
name: clientCertificateSecretName,
namespace: '',
fieldPath: 'data[tls.key]',
},
toFieldPath: 'data[tls.key]',
},
],
// Make crossplane aware of the connection secret we are creating in this object
writeConnectionSecretToRef: {
name: 'redis',
namespace: '',
},
},
};

local prometheusRule = prom.GeneratePrometheusNonSLORules('redis', 'redis', []) + {
patches: [
Expand Down Expand Up @@ -505,24 +443,6 @@ local composition =
comp.CombineCompositeFromOneFieldPath('metadata.labels[crossplane.io/composite]', 'spec.forProvider.manifest.spec.dnsNames[1]', 'redis-headless.vshn-redis-%s.svc'),
],
},
{
name: 'connection',
base: secret,
connectionDetails: comp.conn.AllFromSecretKeys(connectionSecretKeys),
patches: [
comp.FromCompositeFieldPathWithTransformSuffix('metadata.labels[crossplane.io/composite]', 'metadata.name', 'connection'),
comp.FromCompositeFieldPathWithTransformPrefix('metadata.labels[crossplane.io/composite]', 'spec.forProvider.manifest.metadata.namespace', 'vshn-redis'),
comp.FromCompositeFieldPathWithTransformSuffix('metadata.labels[crossplane.io/composite]', 'spec.forProvider.manifest.metadata.name', 'connection'),

comp.CombineCompositeFromOneFieldPath('metadata.labels[crossplane.io/composite]', 'spec.forProvider.manifest.stringData.REDIS_HOST', 'redis-headless.vshn-redis-%s.svc.cluster.local'),
comp.FromCompositeFieldPathWithTransformPrefix('metadata.labels[crossplane.io/composite]', 'spec.references[0].patchesFrom.namespace', 'vshn-redis'),
comp.FromCompositeFieldPathWithTransformPrefix('metadata.labels[crossplane.io/composite]', 'spec.references[1].patchesFrom.namespace', 'vshn-redis'),
comp.FromCompositeFieldPathWithTransformPrefix('metadata.labels[crossplane.io/composite]', 'spec.references[2].patchesFrom.namespace', 'vshn-redis'),
comp.FromCompositeFieldPathWithTransformPrefix('metadata.labels[crossplane.io/composite]', 'spec.references[3].patchesFrom.namespace', 'vshn-redis'),
comp.FromCompositeFieldPathWithTransformPrefix('metadata.labels[crossplane.io/composite]', 'spec.writeConnectionSecretToRef.namespace', 'vshn-redis'),
comp.FromCompositeFieldPathWithTransformSuffix('metadata.labels[crossplane.io/composite]', 'spec.writeConnectionSecretToRef.name', 'connection'),
],
},
{
name: 'release',
base: redisHelmChart,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.45.2-func
package: ghcr.io/vshn/appcat:v4.46.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.45.2-func
package: ghcr.io/vshn/appcat:v4.46.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNREDIS
value: "false"
image: ghcr.io/vshn/appcat:v4.45.2
image: ghcr.io/vshn/appcat:v4.46.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.45.2-func
package: ghcr.io/vshn/appcat:v4.46.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNREDIS
value: "false"
image: ghcr.io/vshn/appcat:v4.45.2
image: ghcr.io/vshn/appcat:v4.46.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.45.2-func
package: ghcr.io/vshn/appcat:v4.46.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.45.2-func
package: ghcr.io/vshn/appcat:v4.46.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
env:
- name: PLANS_NAMESPACE
value: syn-appcat
image: ghcr.io/vshn/appcat:v4.45.2
image: ghcr.io/vshn/appcat:v4.46.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.45.2-func
package: ghcr.io/vshn/appcat:v4.46.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNREDIS
value: "false"
image: ghcr.io/vshn/appcat:v4.45.2
image: ghcr.io/vshn/appcat:v4.46.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.45.2-func
package: ghcr.io/vshn/appcat:v4.46.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNREDIS
value: "false"
image: ghcr.io/vshn/appcat:v4.45.2
image: ghcr.io/vshn/appcat:v4.46.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.45.2-func
package: ghcr.io/vshn/appcat:v4.46.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNREDIS
value: "false"
image: ghcr.io/vshn/appcat:v4.45.2
image: ghcr.io/vshn/appcat:v4.46.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.45.2-func
package: ghcr.io/vshn/appcat:v4.46.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.45.2-func
package: ghcr.io/vshn/appcat:v4.46.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
data:
controlNamespace: syn-appcat-control
defaultPlan: standard-1
imageTag: v4.45.2
imageTag: v4.46.0
maintenanceSA: helm-based-service-maintenance
minioChartRepository: https://charts.min.io
minioChartVersion: 5.0.13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
env:
- name: PLANS_NAMESPACE
value: syn-appcat
image: ghcr.io/vshn/appcat:v4.45.2
image: ghcr.io/vshn/appcat:v4.46.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
envFrom:
- secretRef:
name: appcat-sla-reports-creds
image: ghcr.io/vshn/appcat:v4.45.2
image: ghcr.io/vshn/appcat:v4.46.0
name: sla-reporter
resources:
limits:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNREDIS
value: "false"
image: ghcr.io/vshn/appcat:v4.45.2
image: ghcr.io/vshn/appcat:v4.46.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.45.2-func
package: ghcr.io/vshn/appcat:v4.46.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNREDIS
value: "false"
image: ghcr.io/vshn/appcat:v4.45.2
image: ghcr.io/vshn/appcat:v4.46.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.45.2-func
package: ghcr.io/vshn/appcat:v4.46.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
chartRepository: https://charts.bitnami.com/bitnami
chartVersion: 10.1.3
controlNamespace: syn-appcat-control
imageTag: v4.45.2
imageTag: v4.46.0
isOpenshift: 'false'
maintenanceSA: helm-based-service-maintenance
plans: '{"standard-1": {"size": {"cpu": "250m", "disk": "16Gi", "enabled":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ spec:
emailAlertingSmtpHost: smtp.eu.mailgun.org:465
emailAlertingSmtpUsername: myuser@example.com
externalDatabaseConnectionsEnabled: 'true'
imageTag: v4.45.2
imageTag: v4.46.0
quotasEnabled: 'false'
serviceName: postgresql
sgNamespace: stackgres
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ spec:
emailAlertingSmtpHost: smtp.eu.mailgun.org:465
emailAlertingSmtpUsername: myuser@example.com
externalDatabaseConnectionsEnabled: 'true'
imageTag: v4.45.2
imageTag: v4.46.0
quotasEnabled: 'false'
serviceName: postgresql
sgNamespace: stackgres
Expand Down
Loading

0 comments on commit a115f6c

Please sign in to comment.