Overriding resources for Postgres components on OpenShift
You can optionally override the CPU and Memory resources used by postgres database components.
About this task
There are three postgres components:
The CPU, memory, and PVC resources used by the
pgBackRestcomponents depend on the deployment profile that was selected on installation. The resources that are defined for each deployment profile are shown here: Management component deployment profile limits.
Important: The postgres pod is licensed based on CPU use, so adjusting this pod's CPU limit has licensing implications, see: Component profiles, CPU limits, memory limits, and licensing
To override resources, complete the following procedure
Prepare a patch yaml.
Ensure that you specify the name of the container for the resource you want to override. Names:
- You can override multiple postgres components in parallel. Adding one container section under
- You can override just a single value, such as CPU limit.
- Example yaml, to replace all postgres DB resources:
spec: template: - name: mgmt-pgcluster containers: - name: postgres resources: requests: cpu: 1500m memory: 8Gi limits: cpu: 600m memory: 512Mi
- Example yaml, to replace all
spec: template: - name: mgmt-pgcluster containers: - name: pgBouncer resources: requests: cpu: 200m memory: 128Mi limits: cpu: 300m memory: 256Mi
- Example yaml,to replace CPU limit of
spec: template: - name: mgmt-pgcluster containers: - name: postgres resources: limits: cpu: 1000m
- Example yaml, to replace CPU limits of
spec: template: - name: mgmt-pgcluster containers: - name: postgres resources: limits: cpu: 1000m - name: pgBouncer resources: limits: cpu: 1000m
- Apply the patch yaml:
oc patch apiconnectcluster <apiconnectcluster-cr-name> --type merge --patch "$(cat patch.yaml)"
The postgres components will restart with updated values.