Skip to content

[Cluster chart] Add support for tolerations #834

@ralbon

Description

@ralbon

[Cluster chart] Add support for tolerations

Summary

The cluster chart exposes affinity in values.yaml (see values.yaml around line 247) but does not expose tolerations. The CloudNative-PG Cluster CRD supports tolerations 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 (line 173-174).

Proposed change

  1. In charts/cluster/values.yaml (under cluster): add a tolerations key, e.g.:
# -- 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: []
  1. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions