ITADN

[Cluster chart] Add support for tolerations

#834Openralbon 创建于 2026-03-10
chart( cluster )
R
ralboncommented
# [Cluster chart] Add support for tolerations ## Summary The **cluster** chart exposes `affinity` in `values.yaml` (see [values.yaml](https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/values.yaml) around line 247) but does not expose **tolerations**. The CloudNative-PG Cluster CRD supports [tolerations](https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-ClusterSpec) so that instance pods can be scheduled on tainted nodes (e.g. dedicated DB nodes). It would be useful to be able to set them via the Helm chart values instead of patching the Cluster resource. ## Use case - Schedule PostgreSQL instance pods on nodes with taints (e.g. `dedicated=postgres:NoSchedule`) by adding the corresponding tolerations through chart values. - Align with the operator chart, which already supports `tolerations` in [cloudnative-pg/values.yaml](https://github.com/cloudnative-pg/charts/blob/main/charts/cloudnative-pg/values.yaml) (line 173-174). ## Proposed change 1. **In `charts/cluster/values.yaml`** (under `cluster`): add a `tolerations` key, e.g.: ```yaml # -- Tolerations for the instance pods. Allows scheduling on tainted nodes. # See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-ClusterSpec # Example: schedule on nodes with dedicated=postgres # tolerations: # - key: "dedicated" # operator: "Equal" # value: "postgres" # effect: "NoSchedule" tolerations: [] ``` 2. **In the cluster template** that renders the Cluster manifest: pass `cluster.tolerations` into the Cluster spec (`spec.tolerations`), following the same pattern as `affinity`. ## References - Cluster CRD scheduling: https://cloudnative-pg.io/documentation/current/scheduling/ - Operator chart tolerations: `charts/cloudnative-pg/values.yaml` (`tolerations: []`)
0 条评论