Add patroni_use_kubernetes parameter.

Add a dedicated parameter to enable support for Kubernetes in Patroni
instead of relying on a legacy hack of setting etcd_host to an empty
string. The latter still works, however, it will show a warning, nudging
users to change to the new parameter.

For the sake of not breaking existing non-Kubernetes setups,
patroni_use_kubernetes has not effect if etcd_host is set to a non-empty
value.
This commit is contained in:
Oleksii Kliukin
2018-05-24 17:07:29 +02:00
parent 97d1bde5b6
commit a26d16999a
5 changed files with 21 additions and 9 deletions
+4 -3
View File
@@ -68,9 +68,10 @@ type Config struct {
Auth
Scalyr
WatchedNamespace string `name:"watched_namespace"` // special values: "*" means 'watch all namespaces', the empty string "" means 'watch a namespace where operator is deployed to'
EtcdHost string `name:"etcd_host" default:"etcd-client.default.svc.cluster.local:2379"`
DockerImage string `name:"docker_image" default:"registry.opensource.zalan.do/acid/spiloprivate-9.6:1.2-p4"`
WatchedNamespace string `name:"watched_namespace"` // special values: "*" means 'watch all namespaces', the empty string "" means 'watch a namespace where operator is deployed to'
EtcdHost string `name:"etcd_host" default:"etcd-client.default.svc.cluster.local:2379"`
PatroniUseKubernetes bool `name:"patroni_use_kubernetes" default:"false"`
DockerImage string `name:"docker_image" default:"registry.opensource.zalan.do/acid/spiloprivate-9.6:1.2-p4"`
// default name `operator` enables backward compatibility with the older ServiceAccountName field
PodServiceAccountName string `name:"pod_service_account_name" default:"operator"`
// value of this string must be valid JSON or YAML; see initPodServiceAccount