diff --git a/charts/cluster/README.md b/charts/cluster/README.md index b3d37062ad..5c45ab869e 100644 --- a/charts/cluster/README.md +++ b/charts/cluster/README.md @@ -202,6 +202,7 @@ Kubernetes: `>=1.29.0-0` | cluster.enableSuperuserAccess | bool | `true` | When this option is enabled, the operator will use the SuperuserSecret to update the postgres user password. If the secret is not present, the operator will automatically create one. When this option is disabled, the operator will ignore the SuperuserSecret content, delete it when automatically created, and then blank the password of the postgres user by setting it to NULL. | | cluster.env | list | `[]` | Env follows the Env format to pass environment variables to the pods created in the cluster | | cluster.envFrom | list | `[]` | EnvFrom follows the EnvFrom format to pass environment variables sources to the pods to be used by Env | +| cluster.failoverDelay | int | `0` | The amount of time in seconds to wait before triggering a failover after the primary instance was detected to be unhealthy. Defaults to 0 (immediate failover) when unset, per the operator default. | | cluster.imageCatalogRef | object | `{}` | Reference to `ImageCatalog` of `ClusterImageCatalog`, if specified takes precedence over `cluster.imageName` | | cluster.imageName | string | `""` | Name of the container image, supporting both tags (:) and digests for deterministic and repeatable deployments: :@sha256: | | cluster.imagePullPolicy | string | `"IfNotPresent"` | Image pull policy. One of Always, Never or IfNotPresent. If not defined, it defaults to IfNotPresent. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images | @@ -243,10 +244,13 @@ Kubernetes: `>=1.29.0-0` | cluster.securityContext | object | `{}` | Configure Container Security Context. See: https://cloudnative-pg.io/documentation/preview/security/ | | cluster.serviceAccountTemplate | object | `{}` | Configure the metadata of the generated service account | | cluster.services | object | `{}` | Customization of service definitions. Please refer to https://cloudnative-pg.io/documentation/current/service_management/ | +| cluster.smartShutdownTimeout | int | `180` | The time in seconds reserved for the smart shutdown of Postgres to complete before the operator requests a fast shutdown. Reserve enough time for the fast phase (that is: stopDelay - smartShutdownTimeout). Defaults to 180 when unset, per the operator default. | +| cluster.startDelay | int | `3600` | The time in seconds that is allowed for a PostgreSQL instance to successfully start up. The startup probe failure threshold is derived from this value using the formula ceiling(startDelay / 10). Defaults to 3600 when unset, per the operator default. | | cluster.stopDelay | int | `1800` | The time in seconds that is allowed for the instance to wait for the shutdown to complete before being forcefully terminated. Also sets the pod's terminationGracePeriodSeconds. Defaults to 1800 (30m) when unset, per the operator default. | | cluster.storage.size | string | `"8Gi"` | | | cluster.storage.storageClass | string | `""` | | | cluster.superuserSecret | string | `""` | | +| cluster.switchoverDelay | int | `3600` | The time in seconds that is allowed for a primary instance to gracefully shut down during a switchover. Defaults to 3600 (1h) when unset, per the operator default. | | cluster.walStorage.enabled | bool | `false` | | | cluster.walStorage.size | string | `"1Gi"` | | | cluster.walStorage.storageClass | string | `""` | | diff --git a/charts/cluster/templates/cluster.yaml b/charts/cluster/templates/cluster.yaml index ecf04b6de2..9da371a55c 100644 --- a/charts/cluster/templates/cluster.yaml +++ b/charts/cluster/templates/cluster.yaml @@ -56,6 +56,18 @@ spec: {{- with .Values.cluster.stopDelay }} stopDelay: {{ . }} {{- end }} + {{- with .Values.cluster.smartShutdownTimeout }} + smartShutdownTimeout: {{ . }} + {{- end }} + {{- with .Values.cluster.switchoverDelay }} + switchoverDelay: {{ . }} + {{- end }} + {{- with .Values.cluster.startDelay }} + startDelay: {{ . }} + {{- end }} + {{- with .Values.cluster.failoverDelay }} + failoverDelay: {{ . }} + {{- end }} logLevel: {{ .Values.cluster.logLevel }} {{- with .Values.cluster.certificates }} certificates: diff --git a/charts/cluster/values.schema.json b/charts/cluster/values.schema.json index cf581a8577..d41befb905 100644 --- a/charts/cluster/values.schema.json +++ b/charts/cluster/values.schema.json @@ -318,6 +318,11 @@ }, "type": "array" }, + "failoverDelay": { + "default": 0, + "description": "The amount of time in seconds to wait before triggering a failover after the primary instance was\ndetected to be unhealthy. Defaults to 0 (immediate failover) when unset, per the operator default.", + "type": "integer" + }, "imageCatalogRef": { "description": "Reference to `ImageCatalog` of `ClusterImageCatalog`, if specified takes precedence over `cluster.imageName`", "required": [], @@ -582,6 +587,16 @@ "required": [], "type": "object" }, + "smartShutdownTimeout": { + "default": 180, + "description": "The time in seconds reserved for the smart shutdown of Postgres to complete before the operator\nrequests a fast shutdown. Reserve enough time for the fast phase (that is: stopDelay - smartShutdownTimeout).\nDefaults to 180 when unset, per the operator default.", + "type": "integer" + }, + "startDelay": { + "default": 3600, + "description": "The time in seconds that is allowed for a PostgreSQL instance to successfully start up. The startup\nprobe failure threshold is derived from this value using the formula ceiling(startDelay / 10).\nDefaults to 3600 when unset, per the operator default.", + "type": "integer" + }, "stopDelay": { "default": 1800, "description": "The time in seconds that is allowed for the instance to wait for the shutdown\nto complete before being forcefully terminated. Also sets the pod's terminationGracePeriodSeconds.\nDefaults to 1800 (30m) when unset, per the operator default.", @@ -605,6 +620,11 @@ "default": "", "type": "string" }, + "switchoverDelay": { + "default": 3600, + "description": "The time in seconds that is allowed for a primary instance to gracefully shut down during a switchover.\nDefaults to 3600 (1h) when unset, per the operator default.", + "type": "integer" + }, "walStorage": { "properties": { "enabled": { diff --git a/charts/cluster/values.yaml b/charts/cluster/values.yaml index a85aa39f9b..57d00a0b47 100644 --- a/charts/cluster/values.yaml +++ b/charts/cluster/values.yaml @@ -258,6 +258,24 @@ cluster: # Defaults to 1800 (30m) when unset, per the operator default. stopDelay: 1800 + # -- The time in seconds reserved for the smart shutdown of Postgres to complete before the operator + # requests a fast shutdown. Reserve enough time for the fast phase (that is: stopDelay - smartShutdownTimeout). + # Defaults to 180 when unset, per the operator default. + smartShutdownTimeout: 180 + + # -- The time in seconds that is allowed for a primary instance to gracefully shut down during a switchover. + # Defaults to 3600 (1h) when unset, per the operator default. + switchoverDelay: 3600 + + # -- The time in seconds that is allowed for a PostgreSQL instance to successfully start up. The startup + # probe failure threshold is derived from this value using the formula ceiling(startDelay / 10). + # Defaults to 3600 when unset, per the operator default. + startDelay: 3600 + + # -- The amount of time in seconds to wait before triggering a failover after the primary instance was + # detected to be unhealthy. Defaults to 0 (immediate failover) when unset, per the operator default. + failoverDelay: 0 + # -- The instances' log level, one of the following values: error, warning, info (default), debug, trace logLevel: "info"