Skip to content

Commit 611e48c

Browse files
authored
rename failsafe_mode option in opconfig CRD (zalando#2298)
1 parent 3f4e44d commit 611e48c

11 files changed

+30
-11
lines changed

charts/postgres-operator/crds/operatorconfigurations.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ spec:
670670
patroni:
671671
type: object
672672
properties:
673-
failsafe_mode:
673+
enable_patroni_failsafe_mode:
674674
type: boolean
675675
default: false
676676
status:

charts/postgres-operator/templates/configmap.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ data:
2626
{{- include "flattenValuesForConfigMap" .Values.configLoggingRestApi | indent 2 }}
2727
{{- include "flattenValuesForConfigMap" .Values.configTeamsApi | indent 2 }}
2828
{{- include "flattenValuesForConfigMap" .Values.configConnectionPooler | indent 2 }}
29+
{{- include "flattenValuesForConfigMap" .Values.configPatroni | indent 2 }}
2930
{{- end }}

charts/postgres-operator/templates/operatorconfiguration.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,6 @@ configuration:
4040
{{ toYaml .Values.configLoggingRestApi | indent 4 }}
4141
connection_pooler:
4242
{{ toYaml .Values.configConnectionPooler | indent 4 }}
43+
patroni:
44+
{{ toYaml .Values.configPatroni | indent 4 }}
4345
{{- end }}

charts/postgres-operator/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ configConnectionPooler:
431431

432432
configPatroni:
433433
# enable Patroni DCS failsafe_mode feature
434-
failsafe_mode: false
434+
enable_patroni_failsafe_mode: false
435435

436436
# Zalando's internal CDC stream feature
437437
enableStreams: false

docs/reference/cluster_manifest.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,12 @@ explanation of `ttl` and `loop_wait` parameters.
334334
Patroni `synchronous_node_count` parameter value. Note, this option is only available for Spilo images with Patroni 2.0+. The default is set to `1`. Optional.
335335

336336
* **failsafe_mode**
337-
Patroni `failsafe_mode` parameter value. If enabled, allows Patroni to cope with DCS outages and avoid leader demotion. See the Patroni documentation
338-
[here](https://patroni.readthedocs.io/en/master/dcs_failsafe_mode.html) for more details. This feature is included since Patroni 3.0.0.
339-
Hence, check the container image in use if this feature is included in the used Patroni version. The default is set to `false`. Optional.
337+
Patroni `failsafe_mode` parameter value. If enabled, Patroni will cope
338+
with DCS outages by avoiding leader demotion. See the Patroni documentation
339+
[here](https://patroni.readthedocs.io/en/master/dcs_failsafe_mode.html) for more details.
340+
This feature is included since Patroni 3.0.0. Hence, check the container
341+
image in use if this feature is included in the used Patroni version. The
342+
default is set to `false`. Optional.
340343

341344
## Postgres container resources
342345

docs/reference/operator_parameters.md

+13
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,19 @@ CRD-based configuration.
549549
hard memory minimum what we consider to be required to properly run Postgres
550550
clusters with Patroni on Kubernetes. The default is `250Mi`.
551551

552+
## Patroni options
553+
554+
Parameters configuring Patroni. In the CRD-based configuration they are grouped
555+
under the `patroni` key.
556+
557+
* **enable_patroni_failsafe_mode**
558+
If enabled, Patroni copes with DCS outages by avoiding leader demotion.
559+
See the Patroni documentation [here](https://patroni.readthedocs.io/en/master/dcs_failsafe_mode.html) for more details.
560+
This feature is included since Patroni 3.0.0. Hence, check the container image
561+
in use if this feature is included in the used Patroni version. It can also be
562+
enabled cluster-wise with the `failsafe_mode` flag under the `patroni` section
563+
in the manifest. The default for the global config option is set to `false`.
564+
552565
## Operator timeouts
553566

554567
This set of parameters define various timeouts related to some operator

manifests/configmap.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ data:
4747
enable_master_load_balancer: "false"
4848
enable_master_pooler_load_balancer: "false"
4949
enable_password_rotation: "false"
50-
# enable_patroni_failsafe_mode: "false"
50+
enable_patroni_failsafe_mode: "false"
5151
enable_pgversion_env_var: "true"
5252
# enable_pod_antiaffinity: "false"
5353
# enable_pod_disruption_budget: "true"

manifests/operatorconfiguration.crd.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ spec:
668668
patroni:
669669
type: object
670670
properties:
671-
failsafe_mode:
671+
enable_patroni_failsafe_mode:
672672
type: boolean
673673
default: false
674674
status:

manifests/postgresql-operator-default-configuration.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,5 @@ configuration:
209209
connection_pooler_number_of_instances: 2
210210
# connection_pooler_schema: "pooler"
211211
# connection_pooler_user: "pooler"
212-
# patroni:
213-
# failsafe_mode: "false"
212+
patroni:
213+
enable_patroni_failsafe_mode: false

pkg/apis/acid.zalan.do/v1/crds.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ var OperatorConfigCRDResourceValidation = apiextv1.CustomResourceValidation{
14831483
"patroni": {
14841484
Type: "object",
14851485
Properties: map[string]apiextv1.JSONSchemaProps{
1486-
"failsafe_mode": {
1486+
"enable_patroni_failsafe_mode": {
14871487
Type: "boolean",
14881488
},
14891489
},

pkg/apis/acid.zalan.do/v1/operator_configuration_type.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ type OperatorLogicalBackupConfiguration struct {
240240

241241
// PatroniConfiguration defines configuration for Patroni
242242
type PatroniConfiguration struct {
243-
FailsafeMode *bool `json:"failsafe_mode,omitempty"`
243+
FailsafeMode *bool `json:"enable_patroni_failsafe_mode,omitempty"`
244244
}
245245

246246
// OperatorConfigurationData defines the operation config

0 commit comments

Comments
 (0)