Add libkv Username and Password

This commit is contained in:
Tristan Colgate 2017-03-28 16:54:48 +01:00 committed by Fernandez Ludovic
parent 2f1a7cbf26
commit de6d771bc2
3 changed files with 18 additions and 1 deletions

View file

@ -1305,6 +1305,13 @@ prefix = "/traefik"
# #
# filename = "etcd.tmpl" # filename = "etcd.tmpl"
# Use etcd user/pass authentication
#
# Optional
#
# username = foo
# password = bar
# Enable etcd TLS connection # Enable etcd TLS connection
# #
# Optional # Optional

View file

@ -24,6 +24,8 @@ type Provider struct {
Endpoint string `description:"Comma separated server endpoints"` Endpoint string `description:"Comma separated server endpoints"`
Prefix string `description:"Prefix used for KV store"` Prefix string `description:"Prefix used for KV store"`
TLS *provider.ClientTLS `description:"Enable TLS support"` TLS *provider.ClientTLS `description:"Enable TLS support"`
Username string `description:"KV Username"`
Password string `description:"KV Password"`
StoreType store.Backend StoreType store.Backend
Kvclient store.Store Kvclient store.Store
} }
@ -33,6 +35,8 @@ func (p *Provider) CreateStore() (store.Store, error) {
storeConfig := &store.Config{ storeConfig := &store.Config{
ConnectionTimeout: 30 * time.Second, ConnectionTimeout: 30 * time.Second,
Bucket: "traefik", Bucket: "traefik",
Username: p.Username,
Password: p.Password,
} }
if p.TLS != nil { if p.TLS != nil {

View file

@ -855,6 +855,13 @@
# #
# filename = "etcd.tmpl" # filename = "etcd.tmpl"
# Use etcd user/pass authentication
#
# Optional
#
# username = foo
# password = bar
# Enable etcd TLS connection # Enable etcd TLS connection
# #
# Optional # Optional
@ -865,7 +872,6 @@
# key = "/etc/ssl/etcd.key" # key = "/etc/ssl/etcd.key"
# insecureskipverify = true # insecureskipverify = true
################################################################ ################################################################
# Zookeeper configuration backend # Zookeeper configuration backend
################################################################ ################################################################