mirror of
https://github.com/cozystack/cozystack.git
synced 2026-12-01 20:56:02 +09:00
The sidecar was left without a CPU limit so that a throttled sidecar would slow WAL archiving down rather than fail it. In a tenant with resourceQuotas that does not hold: the tenant LimitRange gives every container a 250m CPU limit by default, so the sidecar gets it and compresses full backups and WAL segments on a quarter of a core. A 1.6 GB database took 30 minutes to back up. Set an explicit one-core limit in both places that build the sidecar configuration, the backup driver and cozy-lib, the same way the memory request and limit already override the LimitRange defaults. Assisted-by: LLM Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
72 lines
1.9 KiB
YAML
72 lines
1.9 KiB
YAML
suite: Barman resources under tenant container limits
|
|
templates:
|
|
- templates/db.yaml
|
|
release:
|
|
name: postgres-source
|
|
namespace: tenant-test
|
|
set:
|
|
_cluster:
|
|
scheduling: {}
|
|
backup:
|
|
destinationPath: s3://backups/test/
|
|
endpointURL: https://s3.example.org
|
|
s3CredentialsSecret:
|
|
name: postgres-backup
|
|
tests:
|
|
- it: sets resources for native backup without inheriting the tenant 128Mi and 250m limits
|
|
set:
|
|
backup.enabled: true
|
|
asserts:
|
|
- equal:
|
|
path: spec.instanceSidecarConfiguration.resources
|
|
value:
|
|
requests:
|
|
cpu: 100m
|
|
memory: 256Mi
|
|
limits:
|
|
cpu: "1"
|
|
memory: 1Gi
|
|
documentSelector:
|
|
path: kind
|
|
value: ObjectStore
|
|
- equal:
|
|
path: spec.configuration.s3Credentials.accessKeyId.name
|
|
value: postgres-backup
|
|
documentSelector:
|
|
path: kind
|
|
value: ObjectStore
|
|
- it: gives recovery its own resources while backup remains disabled
|
|
set:
|
|
backup.enabled: false
|
|
bootstrap:
|
|
enabled: true
|
|
oldName: postgres-original
|
|
asserts:
|
|
- equal:
|
|
path: spec.instanceSidecarConfiguration.resources.limits.memory
|
|
value: 1Gi
|
|
documentSelector:
|
|
path: kind
|
|
value: ObjectStore
|
|
- equal:
|
|
path: metadata.name
|
|
value: postgres-source-recovery
|
|
documentSelector:
|
|
path: kind
|
|
value: ObjectStore
|
|
- equal:
|
|
path: spec.externalClusters[0].plugin.parameters.serverName
|
|
value: postgres-original
|
|
documentSelector:
|
|
path: kind
|
|
value: Cluster
|
|
- it: does not enable backup for an application that has not requested it
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 2
|
|
- notExists:
|
|
path: spec.plugins
|
|
documentSelector:
|
|
path: kind
|
|
value: Cluster
|