Skip to content

Commit

Permalink
Merge pull request #307 from vshn/fix/postgresql_credentials
Browse files Browse the repository at this point in the history
Remove secret observation
  • Loading branch information
Kidswiss authored Jan 24, 2024
2 parents ba9e892 + cd13fa5 commit 1b38ce6
Show file tree
Hide file tree
Showing 33 changed files with 32 additions and 455 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.49.1
tag: v4.51.0
apiserver:
registry: ghcr.io
repository: vshn/appcat-apiserver
Expand Down
85 changes: 0 additions & 85 deletions component/component/vshn_postgres.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -423,90 +423,6 @@ local sgCluster = {
],
};

local secret = {
name: 'connection',
base: comp.KubeObject('v1', 'Secret') +
{
spec+: {
forProvider+: {
manifest+: {
metadata: {},
stringData: {
POSTGRESQL_USER: defaultUser,
POSTGRESQL_PORT: defaultPort,
POSTGRESQL_DB: defaultDB,
POSTGRESQL_HOST: '',
},
},
},
references: [
{
patchesFrom: {
apiVersion: 'v1',
kind: 'Secret',
namespace: '',
name: '',
fieldPath: 'data.superuser-password',
},
toFieldPath: 'data.POSTGRESQL_PASSWORD',
},
{
patchesFrom: {
apiVersion: 'v1',
kind: 'Secret',
name: certificateSecretName,
namespace: '',
fieldPath: 'data[ca.crt]',
},
toFieldPath: 'data[ca.crt]',
},
{
patchesFrom: {
apiVersion: 'v1',
kind: 'Secret',
name: certificateSecretName,
namespace: '',
fieldPath: 'data[tls.crt]',
},
toFieldPath: 'data[tls.crt]',
},
{
patchesFrom: {
apiVersion: 'v1',
kind: 'Secret',
name: certificateSecretName,
namespace: '',
fieldPath: 'data[tls.key]',
},
toFieldPath: 'data[tls.key]',
},
],
// Make crossplane aware of the connection secret we are creating in this object
writeConnectionSecretToRef: {
name: '',
namespace: '',
},
},
},
connectionDetails: comp.conn.AllFromSecretKeys(connectionSecretKeys),
patches: [
comp.ToCompositeFieldPath('status.conditions', 'status.secretConditions'),
comp.FromCompositeFieldPathWithTransformSuffix('metadata.labels[crossplane.io/composite]', 'metadata.name', 'connection'),
comp.FromCompositeFieldPathWithTransformPrefix('metadata.labels[crossplane.io/composite]', 'spec.forProvider.manifest.metadata.namespace', 'vshn-postgresql'),
comp.FromCompositeFieldPathWithTransformSuffix('metadata.labels[crossplane.io/claim-name]', 'spec.forProvider.manifest.metadata.name', 'connection'),

comp.CombineCompositeFromTwoFieldPaths('metadata.labels[crossplane.io/composite]', 'metadata.labels[crossplane.io/composite]', 'spec.forProvider.manifest.stringData.POSTGRESQL_HOST', '%s.vshn-postgresql-%s.svc.cluster.local'),
comp.FromCompositeFieldPathWithTransformPrefix('metadata.labels[crossplane.io/composite]', 'spec.references[0].patchesFrom.namespace', 'vshn-postgresql'),
comp.FromCompositeFieldPath('metadata.labels[crossplane.io/composite]', 'spec.references[0].patchesFrom.name'),
comp.FromCompositeFieldPathWithTransformPrefix('metadata.labels[crossplane.io/composite]', 'spec.writeConnectionSecretToRef.namespace', 'vshn-postgresql'),
comp.FromCompositeFieldPathWithTransformSuffix('metadata.labels[crossplane.io/claim-name]', 'spec.writeConnectionSecretToRef.name', 'connection'),

comp.FromCompositeFieldPathWithTransformPrefix('metadata.labels[crossplane.io/composite]', 'spec.references[1].patchesFrom.namespace', 'vshn-postgresql'),
comp.FromCompositeFieldPathWithTransformPrefix('metadata.labels[crossplane.io/composite]', 'spec.references[2].patchesFrom.namespace', 'vshn-postgresql'),
comp.FromCompositeFieldPathWithTransformPrefix('metadata.labels[crossplane.io/composite]', 'spec.references[3].patchesFrom.namespace', 'vshn-postgresql'),
],
};

local xobjectBucket = {
name: 'pg-bucket',
base: {
Expand Down Expand Up @@ -904,7 +820,6 @@ local composition(restore=false) =
sgPostgresConfig,
sgCluster +
if restore then clusterRestoreConfig else {},
secret,
xobjectBucket,
sgObjectStorage,
podMonitor,
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.49.1-func
package: ghcr.io/vshn/appcat:v4.51.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.49.1-func
package: ghcr.io/vshn/appcat:v4.51.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
value: "false"
- name: APPCAT_SLI_TRACK_OC_MAINTENANCE_STATUS
value: "false"
image: ghcr.io/vshn/appcat:v4.49.1
image: ghcr.io/vshn/appcat:v4.51.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.49.1-func
package: ghcr.io/vshn/appcat:v4.51.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
value: "false"
- name: APPCAT_SLI_TRACK_OC_MAINTENANCE_STATUS
value: "false"
image: ghcr.io/vshn/appcat:v4.49.1
image: ghcr.io/vshn/appcat:v4.51.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.49.1-func
package: ghcr.io/vshn/appcat:v4.51.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.49.1-func
package: ghcr.io/vshn/appcat:v4.51.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.49.1
image: ghcr.io/vshn/appcat:v4.51.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.49.1-func
package: ghcr.io/vshn/appcat:v4.51.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
value: "false"
- name: APPCAT_SLI_TRACK_OC_MAINTENANCE_STATUS
value: "false"
image: ghcr.io/vshn/appcat:v4.49.1
image: ghcr.io/vshn/appcat:v4.51.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.49.1-func
package: ghcr.io/vshn/appcat:v4.51.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
value: "false"
- name: APPCAT_SLI_TRACK_OC_MAINTENANCE_STATUS
value: "false"
image: ghcr.io/vshn/appcat:v4.49.1
image: ghcr.io/vshn/appcat:v4.51.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.49.1-func
package: ghcr.io/vshn/appcat:v4.51.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
value: "false"
- name: APPCAT_SLI_TRACK_OC_MAINTENANCE_STATUS
value: "false"
image: ghcr.io/vshn/appcat:v4.49.1
image: ghcr.io/vshn/appcat:v4.51.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.49.1-func
package: ghcr.io/vshn/appcat:v4.51.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.49.1-func
package: ghcr.io/vshn/appcat:v4.51.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.49.1
imageTag: v4.51.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.49.1
image: ghcr.io/vshn/appcat:v4.51.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.49.1
image: ghcr.io/vshn/appcat:v4.51.0
name: sla-reporter
resources:
limits:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
value: "false"
- name: APPCAT_SLI_TRACK_OC_MAINTENANCE_STATUS
value: "false"
image: ghcr.io/vshn/appcat:v4.49.1
image: ghcr.io/vshn/appcat:v4.51.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.49.1-func
package: ghcr.io/vshn/appcat:v4.51.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
value: "false"
- name: APPCAT_SLI_TRACK_OC_MAINTENANCE_STATUS
value: "false"
image: ghcr.io/vshn/appcat:v4.49.1
image: ghcr.io/vshn/appcat:v4.51.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.49.1-func
package: ghcr.io/vshn/appcat:v4.51.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.49.1
imageTag: v4.51.0
isOpenshift: 'false'
maintenanceSA: helm-based-service-maintenance
plans: '{"standard-1": {"size": {"cpu": "250m", "disk": "16Gi", "enabled":
Expand Down
Loading

0 comments on commit 1b38ce6

Please sign in to comment.