From b304e681592c22c12d6208e2d123054e8db9b233 Mon Sep 17 00:00:00 2001 From: Elliot Charlton <134379345+pselliotc@users.noreply.github.com> Date: Mon, 22 Jul 2024 11:04:22 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"PLAT-453:=20Update=20cloudnative-pg?= =?UTF-8?q?=20helm=20chart=20to=20save=20backups=20to=20shared=20=E2=80=A6?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a1d4f897e06fdbb0306fadce1c7666285044c668. --- charts/cloudnative-pg/Chart.yaml | 2 +- .../templates/crossplane-aws-iam/policy.yaml | 9 +++------ .../templates/stegostore/logical-backup.yaml | 4 +--- .../templates/stegosweep/lifecycle-mgmt.yaml | 4 ++-- charts/cloudnative-pg/values.yaml | 5 +---- 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/charts/cloudnative-pg/Chart.yaml b/charts/cloudnative-pg/Chart.yaml index e418bab..cb341d2 100644 --- a/charts/cloudnative-pg/Chart.yaml +++ b/charts/cloudnative-pg/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: cloudnative-pg description: Create a Postgresql database cluster on AWS EKS using cloudnative-pg.io and any required AWS resources via crossplane.io. type: application -version: 0.1.1-backup-dev-2 +version: 0.1.1 kubeVersion: ">=1.24.0-0" keywords: - postgresql diff --git a/charts/cloudnative-pg/templates/crossplane-aws-iam/policy.yaml b/charts/cloudnative-pg/templates/crossplane-aws-iam/policy.yaml index bbf880b..0facaef 100644 --- a/charts/cloudnative-pg/templates/crossplane-aws-iam/policy.yaml +++ b/charts/cloudnative-pg/templates/crossplane-aws-iam/policy.yaml @@ -22,8 +22,8 @@ spec: ], "Effect": "Allow", "Resource": [ - "arn:aws:s3:::{{ .Values.aws.s3Backups.bucketName }}", - "arn:aws:s3:::{{ .Values.aws.s3Backups.bucketName }}/{{.Values.aws.resourcePrefix}}{{.Values.stackId}}" + "arn:aws:s3:::{{ .Values.aws.resourcePrefix }}{{ .Values.stackId }}", + "arn:aws:s3:::{{ .Values.aws.resourcePrefix }}{{ .Values.stackId }}/*" ] }, { @@ -37,10 +37,7 @@ spec: ], "Condition": { "ForAnyValue:StringLike": { - "kms:ResourceAliases": [ - "alias/{{ .Values.aws.resourcePrefix }}{{ .Values.stackId }}", - "alias/{{ .Values.aws.s3Backups.bucketKmsKeyAlias }}" - ] + "kms:ResourceAliases": "alias/{{ .Values.aws.resourcePrefix }}{{ .Values.stackId }}" } } } diff --git a/charts/cloudnative-pg/templates/stegostore/logical-backup.yaml b/charts/cloudnative-pg/templates/stegostore/logical-backup.yaml index 534ec9d..5ce1092 100644 --- a/charts/cloudnative-pg/templates/stegostore/logical-backup.yaml +++ b/charts/cloudnative-pg/templates/stegostore/logical-backup.yaml @@ -53,9 +53,7 @@ spec: name: postgres-app key: port - name: S3PATH - value: "s3://{{.Values.aws.s3Backups.bucketName}}/{{ .Values.aws.resourcePrefix }}{{ .Values.stackId }}/stegostore/" - - name: KMS_KEY_ID - value: {{ .Values.aws.resourcePrefix }}{{ .Values.stackId }} + value: "s3://{{ .Values.aws.resourcePrefix }}{{ .Values.stackId }}/stegostore/" - name: PGHOST value: "postgres-rw" restartPolicy: Never diff --git a/charts/cloudnative-pg/templates/stegosweep/lifecycle-mgmt.yaml b/charts/cloudnative-pg/templates/stegosweep/lifecycle-mgmt.yaml index 99bfd52..ce04b5a 100644 --- a/charts/cloudnative-pg/templates/stegosweep/lifecycle-mgmt.yaml +++ b/charts/cloudnative-pg/templates/stegosweep/lifecycle-mgmt.yaml @@ -34,9 +34,9 @@ spec: command: ["bash", "/stegosweep.sh"] env: - name: S3_BUCKET_NAME - value: {{ .Values.aws.s3Backups.bucketName }} + value: "{{ .Values.aws.resourcePrefix }}{{ .Values.stackId }}" - name: S3_PREFIX - value: "{{ .Values.aws.resourcePrefix }}{{ .Values.stackId }}/stegostore" + value: "stegostore" - name: DAYS_RETENTION_DAILY value: {{ .Values.stegosweep.daysRetentionDaily | quote }} - name: DAYS_RETENTION_HOURLY diff --git a/charts/cloudnative-pg/values.yaml b/charts/cloudnative-pg/values.yaml index e508829..f153d67 100644 --- a/charts/cloudnative-pg/values.yaml +++ b/charts/cloudnative-pg/values.yaml @@ -8,9 +8,6 @@ aws: rolePath: /my-role-path/ policyPath: /my-policy-path/ permissionsBoundary: arn:aws:iam::123456789012:policy/my-policy-path/my-policy-name - s3Backups: - bucketName: backup-bucket-name - bucketKmsKeyAlias: database-backup-bucket-key cluster: imageName: ghcr.io/cloudnative-pg/postgresql:15.3@sha256:10fa87e8fbf7f1d7d6be3124ef364068e5844e825b17649bc0b2efbab4b54f69 instances: 2 @@ -47,7 +44,7 @@ stegostore: schedule: "0 * * * *" concurrencyPolicy: Forbid imageName: portswigger-cloud/stegostore - imageDigest: sha256:3e4771a813ed530a27b5ac6b009e6961a8bc67f9b9e1b386c09bbb60dd05211d + imageDigest: sha256:c3ee6874873ad41081e95eae17322c6b9424503098262ca0641cf1aa21bf7c08 stegosweep: enabled: true schedule: "30 1 * * *"