mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-01 08:47:03 +02:00
Add hugepages 2Mi and 1Gi fields to ResourceDescription and pass them to the statefulset (#2311)
* Add hugepages-2Mi and 1Gi to ResourceDescription type and crd (#1549, #1788) * Add tests for hugepages resource requests/limits * Add tests for hugepages resource requests/limits on sidecars, too * Add docs for hugepages support * Add link to kubernetes docs on hugepages * Add tests for hugepages not being set on container if not requested in custom resource * Add hugepages resources fields to manifest docs * Add hugepages resources fields to complete manifest example * Add hugepages resources fields to chart crd --------- Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
This commit is contained in:
@@ -359,6 +359,14 @@ CPU and memory requests for the Postgres container.
|
||||
memory requests for the Postgres container. Optional, overrides the
|
||||
`default_memory_request` operator configuration parameter.
|
||||
|
||||
* **hugepages-2Mi**
|
||||
hugepages-2Mi requests for the sidecar container.
|
||||
Optional, defaults to not set.
|
||||
|
||||
* **hugepages-1Gi**
|
||||
1Gi hugepages requests for the sidecar container.
|
||||
Optional, defaults to not set.
|
||||
|
||||
### Limits
|
||||
|
||||
CPU and memory limits for the Postgres container.
|
||||
@@ -371,6 +379,14 @@ CPU and memory limits for the Postgres container.
|
||||
memory limits for the Postgres container. Optional, overrides the
|
||||
`default_memory_limits` operator configuration parameter.
|
||||
|
||||
* **hugepages-2Mi**
|
||||
hugepages-2Mi requests for the sidecar container.
|
||||
Optional, defaults to not set.
|
||||
|
||||
* **hugepages-1Gi**
|
||||
1Gi hugepages requests for the sidecar container.
|
||||
Optional, defaults to not set.
|
||||
|
||||
## Parameters defining how to clone the cluster from another one
|
||||
|
||||
Those parameters are applied when the cluster should be a clone of another one
|
||||
@@ -500,6 +516,14 @@ CPU and memory requests for the sidecar container.
|
||||
memory requests for the sidecar container. Optional, overrides the
|
||||
`default_memory_request` operator configuration parameter. Optional.
|
||||
|
||||
* **hugepages-2Mi**
|
||||
hugepages-2Mi requests for the sidecar container.
|
||||
Optional, defaults to not set.
|
||||
|
||||
* **hugepages-1Gi**
|
||||
1Gi hugepages requests for the sidecar container.
|
||||
Optional, defaults to not set.
|
||||
|
||||
### Limits
|
||||
|
||||
CPU and memory limits for the sidecar container.
|
||||
@@ -512,6 +536,14 @@ CPU and memory limits for the sidecar container.
|
||||
memory limits for the sidecar container. Optional, overrides the
|
||||
`default_memory_limits` operator configuration parameter. Optional.
|
||||
|
||||
* **hugepages-2Mi**
|
||||
hugepages-2Mi requests for the sidecar container.
|
||||
Optional, defaults to not set.
|
||||
|
||||
* **hugepages-1Gi**
|
||||
1Gi hugepages requests for the sidecar container.
|
||||
Optional, defaults to not set.
|
||||
|
||||
## Connection pooler
|
||||
|
||||
Parameters are grouped under the `connectionPooler` top-level key and specify
|
||||
|
||||
@@ -690,6 +690,27 @@ manifest the operator will raise the limits to the configured minimum values.
|
||||
If no resources are defined in the manifest they will be obtained from the
|
||||
configured [default requests](reference/operator_parameters.md#kubernetes-resource-requests).
|
||||
|
||||
### HugePages support
|
||||
|
||||
The operator supports [HugePages](https://www.postgresql.org/docs/15/kernel-resources.html#LINUX-HUGEPAGES).
|
||||
To enable HugePages, set the matching resource requests and/or limits in the manifest:
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
resources:
|
||||
requests:
|
||||
hugepages-2Mi: 250Mi
|
||||
hugepages-1Gi: 1Gi
|
||||
limits:
|
||||
hugepages-2Mi: 500Mi
|
||||
hugepages-1Gi: 2Gi
|
||||
```
|
||||
|
||||
There are no minimums or maximums and the default is 0 for both HugePage sizes,
|
||||
but Kubernetes will not spin up the pod if the requested HugePages cannot be allocated.
|
||||
For more information on HugePages in Kubernetes, see also
|
||||
[https://kubernetes.io/docs/tasks/manage-hugepages/scheduling-hugepages/](https://kubernetes.io/docs/tasks/manage-hugepages/scheduling-hugepages/)
|
||||
|
||||
## Use taints, tolerations and node affinity for dedicated PostgreSQL nodes
|
||||
|
||||
To ensure Postgres pods are running on nodes without any other application pods,
|
||||
|
||||
Reference in New Issue
Block a user