cloudnative-pg / cloudnative-pg/charts
[Cluster chart] Add support for failoverDelay
- Dominant language
- Go Template
- Stars
- 621
- Forks
- 265
- Avg merge
- 7d 12h
- Merged PRs (30d)
- 7
Description
The CNPG `Cluster` CRD supports [`spec.failoverDelay`](https://cloudnative-pg.io/documentation/current/cluster_conf/#failover) (integer seconds — delay before a primary is failed over once judged unhealthy), but the `cluster` chart does not expose it as a values key. Setting `cluster.failoverDelay` in values is silently dropped by the template.
This makes it impossible to use the chart for clusters that need to ride out brief instance-manager / kubelet hiccups without spurious failovers — which on storage without WAL archiving (eg. file-thinpool, local PV) can leave the old primary divergent with no `pg_rewind` archive to fall back to.
## Reproducer
```yaml
# values.yaml
cluster:
failoverDelay: 30
```
```bash
helm template foo cloudnative-pg/cluster --version 0.6.1 -f values.yaml | grep failoverDelay
# (no output — chart never templates the field)
```
## Proposed shape
Same pattern as #834 / #867 — small wire-up.
**`values.yaml`** (under `cluster:`):
```yaml
# -- Seconds to wait before triggering a failover after the primary is considered unhealthy.
# See https://cloudnative-pg.io/documentation/current/cluster_conf/#failover
failoverDelay: 0
```
**`templates/cluster.yaml`** (next to `primaryUpdateMethod`):
```yaml
failoverDelay: {{ .Values.cluster.failoverDelay }}
```
Happy to open a PR if the direction looks right.
Contributor guide
Assessment
This issue has not been assessed yet.