mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-03 16:21:17 +02:00
committed by
Sergey Dudoladov
parent
2e9b6533e7
commit
26a7fdfa9f
@@ -151,6 +151,36 @@ Postgres pods by default receive tolerations for `unreachable` and `noExecute` t
|
||||
Depending on your setup, you may want to adjust these parameters to prevent master pods from being evicted by the Kubernetes runtime.
|
||||
To prevent eviction completely, specify the toleration by leaving out the `tolerationSeconds` value (similar to how Kubernetes' own DaemonSets are configured)
|
||||
|
||||
### Enable pod anti affinity
|
||||
|
||||
To ensure Postgres pods are running on different topologies, you can use [pod anti affinity](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/)
|
||||
and configure the required topology in the operator ConfigMap.
|
||||
|
||||
Enable pod anti affinity by adding following line to the operator ConfigMap:
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: postgres-operator
|
||||
data:
|
||||
enable_pod_antiaffinity: "true"
|
||||
```
|
||||
|
||||
By default the topology key for the pod anti affinity is set to `kubernetes.io/hostname`,
|
||||
you can set another topology key e.g. `failure-domain.beta.kubernetes.io/zone` by adding following line
|
||||
to the operator ConfigMap, see [built-in node labels](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#interlude-built-in-node-labels) for available topology keys:
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: postgres-operator
|
||||
data:
|
||||
enable_pod_antiaffinity: "true"
|
||||
pod_antiaffinity_topology_key: "failure-domain.beta.kubernetes.io/zone"
|
||||
```
|
||||
|
||||
### Add cluster-specific labels
|
||||
|
||||
In some cases, you might want to add `labels` that are specific to a given
|
||||
|
||||
@@ -213,6 +213,14 @@ configuration they are grouped under the `kubernetes` key.
|
||||
that should be assigned to the Postgres pods. The priority class itself must be defined in advance.
|
||||
Default is empty (use the default priority class).
|
||||
|
||||
* **enable_pod_antiaffinity**
|
||||
toggles [pod anti affinity](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/) on the Postgres pods, to avoid multiple pods
|
||||
of the same Postgres cluster in the same topology , e.g. node. The default is `false`.
|
||||
|
||||
* **pod_antiaffinity_topology_key**
|
||||
override
|
||||
[topology key](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#interlude-built-in-node-labels)
|
||||
for pod anti affinity. The default is `kubernetes.io/hostname`.
|
||||
|
||||
## Kubernetes resource requests
|
||||
|
||||
|
||||
Reference in New Issue
Block a user