From ca1e7018536189541ba4ee82c37dd0d0027abef4 Mon Sep 17 00:00:00 2001 From: Natalia Marukovich Date: Tue, 25 Mar 2025 19:22:02 +0100 Subject: [PATCH 1/2] add resources to repoHost --- deploy/cr.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deploy/cr.yaml b/deploy/cr.yaml index 7097126128..2cedcc8ca5 100644 --- a/deploy/cr.yaml +++ b/deploy/cr.yaml @@ -383,6 +383,10 @@ spec: # repo3-path: /pgbackrest/postgres-operator/cluster1-multi-repo/repo3 # repo4-path: /pgbackrest/postgres-operator/cluster1-multi-repo/repo4 repoHost: +# resources: +# limits: +# cpu: 200m +# memory: 128Mi affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: From de0ad478ae8c0800376e1c6238102f4791866e3f Mon Sep 17 00:00:00 2001 From: Natalia Marukovich Date: Tue, 1 Apr 2025 16:50:22 +0200 Subject: [PATCH 2/2] add repoHost resources to the test --- e2e-tests/tests/init-deploy/01-assert.yaml | 46 +++++++++++++++++++ .../tests/init-deploy/01-create-cluster.yaml | 2 + 2 files changed, 48 insertions(+) diff --git a/e2e-tests/tests/init-deploy/01-assert.yaml b/e2e-tests/tests/init-deploy/01-assert.yaml index c47c98d0db..8fa3e514b1 100644 --- a/e2e-tests/tests/init-deploy/01-assert.yaml +++ b/e2e-tests/tests/init-deploy/01-assert.yaml @@ -17,6 +17,52 @@ metadata: name: init-deploy controller: true blockOwnerDeletion: true +spec: + serviceName: init-deploy-pods + template: + metadata: + annotations: + test-annotation: test + spec: + containers: + - command: + - pgbackrest + - server + name: pgbackrest + resources: + limits: + cpu: 200m + memory: 128Mi + - command: + - bash + - -ceu + - -- + - |- + monitor() { + exec {fd}<> <(:||:) + until read -r -t 5 -u "${fd}"; do + if + [[ "${filename}" -nt "/proc/self/fd/${fd}" ]] && + pkill -HUP --exact --parent=0 pgbackrest + then + exec {fd}>&- && exec {fd}<> <(:||:) + stat --dereference --format='Loaded configuration dated %y' "${filename}" + elif + { [[ "${directory}" -nt "/proc/self/fd/${fd}" ]] || + [[ "${authority}" -nt "/proc/self/fd/${fd}" ]] + } && + pkill -HUP --exact --parent=0 pgbackrest + then + exec {fd}>&- && exec {fd}<> <(:||:) + stat --format='Loaded certificates dated %y' "${directory}" + fi + done + }; export directory="$1" authority="$2" filename="$3"; export -f monitor; exec -a "$0" bash -ceu monitor + - pgbackrest-config + - /etc/pgbackrest/server + - /etc/pgbackrest/conf.d/~postgres-operator/tls-ca.crt + - /etc/pgbackrest/conf.d/~postgres-operator_server.conf + name: pgbackrest-config status: observedGeneration: 1 replicas: 1 diff --git a/e2e-tests/tests/init-deploy/01-create-cluster.yaml b/e2e-tests/tests/init-deploy/01-create-cluster.yaml index c337b9fa3d..515e681822 100644 --- a/e2e-tests/tests/init-deploy/01-create-cluster.yaml +++ b/e2e-tests/tests/init-deploy/01-create-cluster.yaml @@ -11,4 +11,6 @@ commands: get_cr \ | yq '.spec.metadata.labels.test-label = "test"' \ | yq '.spec.metadata.annotations.test-annotation = "test"' \ + | yq '.spec.backups.pgbackrest.repoHost.resources.limits.cpu = "200m"' \ + | yq '.spec.backups.pgbackrest.repoHost.resources.limits.memory = "128Mi"' \ | kubectl -n "${NAMESPACE}" apply -f -