add config option to change affinity merge behavior

This commit is contained in:
Felix Kunde
2022-01-12 13:21:19 +01:00
parent 92db09182e
commit 596ad5375d
13 changed files with 52 additions and 18 deletions
+6 -3
View File
@@ -370,7 +370,10 @@ configuration:
The operator will create a `nodeAffinity` on the pods. This makes the
`node_readiness_label` option the global configuration for defining node
affinities for all Postgres clusters. You can have both, cluster-specific and
global affinity, defined and they will get merged on the pods (AND condition).
global affinity, defined and they will get merged on the pods. If
`node_readiness_label_merge` is configured to `"AND"` the node readiness
affinity will end up under the same `matchExpressions` section(s) from the
manifest affinity.
```yaml
affinity:
@@ -390,8 +393,8 @@ global affinity, defined and they will get merged on the pods (AND condition).
...
```
If multiple `matchExpressions` are defined in the manifest (OR condition) the
readiness label configuration will be appended with its own expressions block:
If `node_readiness_label_merge` is set to `"OR"` (default) the readiness label
affinty will be appended with its own expressions block:
```yaml
affinity:
+8 -3
View File
@@ -342,9 +342,14 @@ configuration they are grouped under the `kubernetes` key.
a set of labels that a running and active node should possess to be
considered `ready`. When the set is not empty, the operator assigns the
`nodeAffinity` clause to the Postgres pods to be scheduled only on `ready`
nodes. If a `nodeAffinity` is also specified in the postgres cluster
manifest both affinities will get merged on the pods. See [user docs](../user.md#use-taints-tolerations-and-node-affinity-for-dedicated-postgresql-nodes)
for more details. The default is empty.
nodes. The default is empty.
* **node_readiness_label_merge**
If a `nodeAffinity` is also specified in the postgres cluster manifest
it will get merged with the `node_readiness_label` affinity on the pods.
The merge strategy can be configured - it can either be "AND" or "OR".
See [user docs](../user.md#use-taints-tolerations-and-node-affinity-for-dedicated-postgresql-nodes)
for more details. Default is "OR".
* **toleration**
a dictionary that should contain `key`, `operator`, `value` and