diff --git a/docs/ENVIRONMENT.rst b/docs/ENVIRONMENT.rst index 0116cdf3..f18920e8 100644 --- a/docs/ENVIRONMENT.rst +++ b/docs/ENVIRONMENT.rst @@ -46,13 +46,17 @@ Consul Etcd ---- -- **PATRONI\_ETCD\_HOST**: the host:port for the etcd endpoint. -- **PATRONI\_ETCD\_HOSTS**: list of etcd endpoints in format 'host1:port1','host2:port2',etc... -- **PATRONI\_ETCD\_URL**: url for the etcd, in format: http(s)://(username:password@)host:port + - **PATRONI\_ETCD\_PROXY**: proxy url for the etcd. If you are connecting to the etcd using proxy, use this parameter instead of **PATRONI\_ETCD\_URL** +- **PATRONI\_ETCD\_URL**: url for the etcd, in format: http(s)://(username:password@)host:port +- **PATRONI\_ETCD\_HOSTS**: list of etcd endpoints in format 'host1:port1','host2:port2',etc... +- **PATRONI\_ETCD\_PROTOCOL**: http or https, if not specified http is used. If the **url** or **proxy** is specified - will take protocol from them. +- **PATRONI\_ETCD\_HOST**: the host:port for the etcd endpoint. - **PATRONI\_ETCD\_SRV**: Domain to search the SRV record(s) for cluster autodiscovery. +- **PATRONI\_ETCD\_USERNAME**: username for etcd authentication. +- **PATRONI\_ETCD\_PASSWORD**: password for etcd authentication. - **PATRONI\_ETCD\_CACERT**: The ca certificate. If present it will enable validation. -- **PATRONI\_ETCD\_CERT**: File with the client certificate +- **PATRONI\_ETCD\_CERT**: File with the client certificate. - **PATRONI\_ETCD\_KEY**: File with the client key. Can be empty if the key is part of certificate. Exhibitor diff --git a/docs/SETTINGS.rst b/docs/SETTINGS.rst index a3cea35d..74e43a07 100644 --- a/docs/SETTINGS.rst +++ b/docs/SETTINGS.rst @@ -101,10 +101,10 @@ Most of the parameters are optional, but you have to specify one of the **host** - **proxy**: proxy url for the etcd. If you are connecting to the etcd using proxy, use this parameter instead of **url** - **srv**: Domain to search the SRV record(s) for cluster autodiscovery. - **protocol**: (optional) http or https, if not specified http is used. If the **url** or **proxy** is specified - will take protocol from them. -- **username**: (optional) username for etcd authentication +- **username**: (optional) username for etcd authentication. - **password**: (optional) password for etcd authentication. - **cacert**: (optional) The ca certificate. If present it will enable validation. -- **cert**: (optional) file with the client certificate +- **cert**: (optional) file with the client certificate. - **key**: (optional) file with the client key. Can be empty if the key is part of **cert**. Exhibitor diff --git a/patroni/config.py b/patroni/config.py index 62560821..2c481021 100644 --- a/patroni/config.py +++ b/patroni/config.py @@ -288,9 +288,10 @@ class Config(object): name, suffix = (param[8:].split('_', 1) + [''])[:2] if name and suffix: # PATRONI_(ETCD|CONSUL|ZOOKEEPER|EXHIBITOR|...)_(HOSTS?|PORT|..) - if suffix in ('HOST', 'HOSTS', 'PORT', 'SRV', 'URL', 'PROXY', 'CACERT', 'CERT', 'KEY', 'VERIFY', - 'TOKEN', 'CHECKS', 'DC', 'REGISTER_SERVICE', 'SERVICE_CHECK_INTERVAL', 'NAMESPACE', - 'CONTEXT', 'USE_ENDPOINTS', 'SCOPE_LABEL', 'ROLE_LABEL', 'POD_IP', 'PORTS', 'LABELS'): + if suffix in ('HOST', 'HOSTS', 'PORT', 'PROTOCOL', 'SRV', 'URL', 'PROXY', 'CACERT', 'CERT', + 'KEY', 'USERNAME', 'PASSWORD', 'VERIFY', 'TOKEN', 'CHECKS', 'DC', 'REGISTER_SERVICE', + 'SERVICE_CHECK_INTERVAL', 'NAMESPACE', 'CONTEXT', 'USE_ENDPOINTS', 'SCOPE_LABEL', + 'ROLE_LABEL', 'POD_IP', 'PORTS', 'LABELS'): value = os.environ.pop(param) if suffix == 'PORT': value = value and parse_int(value)