From cc730fc545bc0f29dd32ecc8f1892d416ddc0d07 Mon Sep 17 00:00:00 2001 From: Adam Vollrath Date: Tue, 12 Dec 2023 14:30:19 -0600 Subject: [PATCH 1/4] Update `postgres` data mount point to persist. Signed-off-by: Adam Vollrath --- .github/uffizzi/k8s/manifests/pg-deploy.yaml | 5 ++++- .github/workflows/uffizzi-build.yml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/uffizzi/k8s/manifests/pg-deploy.yaml b/.github/uffizzi/k8s/manifests/pg-deploy.yaml index 354acd8e87..4f49b309ca 100644 --- a/.github/uffizzi/k8s/manifests/pg-deploy.yaml +++ b/.github/uffizzi/k8s/manifests/pg-deploy.yaml @@ -19,11 +19,14 @@ spec: imagePullPolicy: 'IfNotPresent' ports: - containerPort: 5432 + env: + - name: PGDATA + value: "/data/pgdata" envFrom: - secretRef: name: postgres-secrets volumeMounts: - - mountPath: /var/lib/postgresql + - mountPath: /data name: postgresdb volumes: - name: postgresdb diff --git a/.github/workflows/uffizzi-build.yml b/.github/workflows/uffizzi-build.yml index 4eaf2c2dc0..347e525add 100644 --- a/.github/workflows/uffizzi-build.yml +++ b/.github/workflows/uffizzi-build.yml @@ -56,7 +56,7 @@ jobs: - name: Generate UUID image name id: uuid - run: echo "UUID_TAG_APP=$(uuidgen)" >> $GITHUB_ENV + run: echo "UUID_TAG_APP=backstage-$(uuidgen)" >> $GITHUB_ENV - name: Docker metadata id: meta From 14c3bfc91d8bd42764a14dd814bd8b1ac0a0a90d Mon Sep 17 00:00:00 2001 From: Adam Vollrath Date: Tue, 12 Dec 2023 15:07:47 -0600 Subject: [PATCH 2/4] Use time-based UUID image name. Signed-off-by: Adam Vollrath --- .github/workflows/uffizzi-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/uffizzi-build.yml b/.github/workflows/uffizzi-build.yml index 347e525add..bfa6a0a373 100644 --- a/.github/workflows/uffizzi-build.yml +++ b/.github/workflows/uffizzi-build.yml @@ -56,7 +56,7 @@ jobs: - name: Generate UUID image name id: uuid - run: echo "UUID_TAG_APP=backstage-$(uuidgen)" >> $GITHUB_ENV + run: echo "UUID_TAG_APP=backstage-$(uuidgen --time)" >> $GITHUB_ENV - name: Docker metadata id: meta From cb5787edec94ad87b666180230266ae9e7387f4f Mon Sep 17 00:00:00 2001 From: Adam Vollrath Date: Wed, 13 Dec 2023 09:30:49 -0600 Subject: [PATCH 3/4] Conform to YAML style conventions. Signed-off-by: Adam Vollrath --- .github/uffizzi/k8s/manifests/pg-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/uffizzi/k8s/manifests/pg-deploy.yaml b/.github/uffizzi/k8s/manifests/pg-deploy.yaml index 4f49b309ca..a72b6b8c83 100644 --- a/.github/uffizzi/k8s/manifests/pg-deploy.yaml +++ b/.github/uffizzi/k8s/manifests/pg-deploy.yaml @@ -21,7 +21,7 @@ spec: - containerPort: 5432 env: - name: PGDATA - value: "/data/pgdata" + value: '/data/pgdata' envFrom: - secretRef: name: postgres-secrets From 7105b490d9d604d0902aab0bc997a8e794b65c01 Mon Sep 17 00:00:00 2001 From: Adam Vollrath Date: Wed, 13 Dec 2023 10:54:31 -0600 Subject: [PATCH 4/4] Add explicit resource requests. Signed-off-by: Adam Vollrath --- .github/uffizzi/k8s/manifests/backstage-deploy.yaml | 7 +++++++ .github/uffizzi/k8s/manifests/pg-deploy.yaml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/.github/uffizzi/k8s/manifests/backstage-deploy.yaml b/.github/uffizzi/k8s/manifests/backstage-deploy.yaml index 9bf62e991a..2c1458cfea 100644 --- a/.github/uffizzi/k8s/manifests/backstage-deploy.yaml +++ b/.github/uffizzi/k8s/manifests/backstage-deploy.yaml @@ -35,3 +35,10 @@ spec: value: 'postgres.default.svc.cluster.local' - name: NODE_ENV value: production + resources: + limits: + cpu: 1000m + memory: 384Mi + requests: + cpu: 20m + memory: 160Mi diff --git a/.github/uffizzi/k8s/manifests/pg-deploy.yaml b/.github/uffizzi/k8s/manifests/pg-deploy.yaml index a72b6b8c83..b842328978 100644 --- a/.github/uffizzi/k8s/manifests/pg-deploy.yaml +++ b/.github/uffizzi/k8s/manifests/pg-deploy.yaml @@ -25,6 +25,13 @@ spec: envFrom: - secretRef: name: postgres-secrets + resources: + limits: + cpu: 1000m + memory: 256Mi + requests: + cpu: 10m + memory: 96Mi volumeMounts: - mountPath: /data name: postgresdb