Support YAML for the dynamic configuration.
This commit is contained in:
parent
96962dd21f
commit
e69d4cba88
36 changed files with 1529 additions and 289 deletions
7
pkg/provider/file/fixtures/toml/dir01_file01.toml
Normal file
7
pkg/provider/file/fixtures/toml/dir01_file01.toml
Normal file
|
@ -0,0 +1,7 @@
|
|||
[http.routers]
|
||||
|
||||
[http.routers."router1"]
|
||||
service = "application-1"
|
||||
|
||||
[http.routers."router2"]
|
||||
service = "application-2"
|
13
pkg/provider/file/fixtures/toml/dir01_file02.toml
Normal file
13
pkg/provider/file/fixtures/toml/dir01_file02.toml
Normal file
|
@ -0,0 +1,13 @@
|
|||
[http.services]
|
||||
|
||||
[http.services.application-1.loadbalancer]
|
||||
[[http.services.application-1.loadbalancer.servers]]
|
||||
url = "http://172.17.0.1:80"
|
||||
|
||||
[http.services.application-2.loadbalancer]
|
||||
[[http.services.application-2.loadbalancer.servers]]
|
||||
url = "http://172.17.0.2:80"
|
||||
|
||||
[http.services.application-3.loadbalancer]
|
||||
[[http.services.application-3.loadbalancer.servers]]
|
||||
url = "http://172.17.0.3:80"
|
16
pkg/provider/file/fixtures/toml/dir01_file03.toml
Normal file
16
pkg/provider/file/fixtures/toml/dir01_file03.toml
Normal file
|
@ -0,0 +1,16 @@
|
|||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest1.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest1.com.key"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest2.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest2.com.key"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest3.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest3.com.key"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest4.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest4.com.key"
|
55
pkg/provider/file/fixtures/toml/simple_file_01.toml
Normal file
55
pkg/provider/file/fixtures/toml/simple_file_01.toml
Normal file
|
@ -0,0 +1,55 @@
|
|||
[http.routers]
|
||||
|
||||
[http.routers."router1"]
|
||||
service = "application-1"
|
||||
|
||||
[http.routers."router2"]
|
||||
service = "application-2"
|
||||
|
||||
[http.routers."router3"]
|
||||
service = "application-3"
|
||||
[http.services]
|
||||
|
||||
[http.services.application-1.loadbalancer]
|
||||
[[http.services.application-1.loadbalancer.servers]]
|
||||
url = "http://172.17.0.1:80"
|
||||
|
||||
[http.services.application-2.loadbalancer]
|
||||
[[http.services.application-2.loadbalancer.servers]]
|
||||
url = "http://172.17.0.2:80"
|
||||
|
||||
[http.services.application-3.loadbalancer]
|
||||
[[http.services.application-3.loadbalancer.servers]]
|
||||
url = "http://172.17.0.3:80"
|
||||
|
||||
[http.services.application-4.loadbalancer]
|
||||
[[http.services.application-4.loadbalancer.servers]]
|
||||
url = "http://172.17.0.4:80"
|
||||
|
||||
[http.services.application-5.loadbalancer]
|
||||
[[http.services.application-5.loadbalancer.servers]]
|
||||
url = "http://172.17.0.5:80"
|
||||
|
||||
[http.services.application-6.loadbalancer]
|
||||
[[http.services.application-6.loadbalancer.servers]]
|
||||
url = "http://172.17.0.6:80"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest1.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest1.com.key"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest2.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest2.com.key"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest3.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest3.com.key"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest4.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest4.com.key"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest5.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest5.com.key"
|
62
pkg/provider/file/fixtures/toml/simple_file_02.toml
Normal file
62
pkg/provider/file/fixtures/toml/simple_file_02.toml
Normal file
|
@ -0,0 +1,62 @@
|
|||
[http.routers]
|
||||
|
||||
[http.routers."router1"]
|
||||
service = "application-1"
|
||||
|
||||
[http.routers."router2"]
|
||||
service = "application-2"
|
||||
|
||||
[http.routers."router3"]
|
||||
service = "application-3"
|
||||
|
||||
[http.routers."router4"]
|
||||
service = "application-4"
|
||||
[http.services]
|
||||
|
||||
[http.services.application-1.loadbalancer]
|
||||
[[http.services.application-1.loadbalancer.servers]]
|
||||
url = "http://172.17.0.1:80"
|
||||
|
||||
[http.services.application-2.loadbalancer]
|
||||
[[http.services.application-2.loadbalancer.servers]]
|
||||
url = "http://172.17.0.2:80"
|
||||
|
||||
[http.services.application-3.loadbalancer]
|
||||
[[http.services.application-3.loadbalancer.servers]]
|
||||
url = "http://172.17.0.3:80"
|
||||
|
||||
[http.services.application-4.loadbalancer]
|
||||
[[http.services.application-4.loadbalancer.servers]]
|
||||
url = "http://172.17.0.4:80"
|
||||
|
||||
[http.services.application-5.loadbalancer]
|
||||
[[http.services.application-5.loadbalancer.servers]]
|
||||
url = "http://172.17.0.5:80"
|
||||
|
||||
[http.services.application-6.loadbalancer]
|
||||
[[http.services.application-6.loadbalancer.servers]]
|
||||
url = "http://172.17.0.6:80"
|
||||
|
||||
[http.services.application-7.loadbalancer]
|
||||
[[http.services.application-7.loadbalancer.servers]]
|
||||
url = "http://172.17.0.7:80"
|
||||
|
||||
[http.services.application-8.loadbalancer]
|
||||
[[http.services.application-8.loadbalancer.servers]]
|
||||
url = "http://172.17.0.8:80"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest1.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest1.com.key"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest2.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest2.com.key"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest3.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest3.com.key"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest4.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest4.com.key"
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
[log]
|
||||
level = "DEBUG"
|
38
pkg/provider/file/fixtures/toml/simple_traefik_file_02.toml
Normal file
38
pkg/provider/file/fixtures/toml/simple_traefik_file_02.toml
Normal file
|
@ -0,0 +1,38 @@
|
|||
[providers.file]
|
||||
|
||||
[http.routers]
|
||||
|
||||
[http.routers."router1"]
|
||||
service = "application-1"
|
||||
|
||||
[http.routers."router2"]
|
||||
service = "application-2"
|
||||
[http.services]
|
||||
|
||||
[http.services.application-1.loadbalancer]
|
||||
[[http.services.application-1.loadbalancer.servers]]
|
||||
url = "http://172.17.0.1:80"
|
||||
|
||||
[http.services.application-2.loadbalancer]
|
||||
[[http.services.application-2.loadbalancer.servers]]
|
||||
url = "http://172.17.0.2:80"
|
||||
|
||||
[http.services.application-3.loadbalancer]
|
||||
[[http.services.application-3.loadbalancer.servers]]
|
||||
url = "http://172.17.0.3:80"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest1.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest1.com.key"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest2.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest2.com.key"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest3.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest3.com.key"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest4.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest4.com.key"
|
|
@ -0,0 +1,39 @@
|
|||
|
||||
temp="{{ getTag \"test\" }}"
|
||||
[providers.file]
|
||||
[http.routers]
|
||||
|
||||
[http.routers."router1"]
|
||||
service = "application-1"
|
||||
|
||||
[http.routers."router2"]
|
||||
service = "application-2"
|
||||
[http.services]
|
||||
|
||||
[http.services.application-1.loadbalancer]
|
||||
[[http.services.application-1.loadbalancer.servers]]
|
||||
url = "http://172.17.0.1:80"
|
||||
|
||||
[http.services.application-2.loadbalancer]
|
||||
[[http.services.application-2.loadbalancer.servers]]
|
||||
url = "http://172.17.0.2:80"
|
||||
|
||||
[http.services.application-3.loadbalancer]
|
||||
[[http.services.application-3.loadbalancer.servers]]
|
||||
url = "http://172.17.0.3:80"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest1.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest1.com.key"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest2.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest2.com.key"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest3.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest3.com.key"
|
||||
[[TLS]]
|
||||
[TLS.Certificate]
|
||||
CertFile = "integration/fixtures/https/snitest4.com.cert"
|
||||
KeyFile = "integration/fixtures/https/snitest4.com.key"
|
6
pkg/provider/file/fixtures/toml/template_file.toml
Normal file
6
pkg/provider/file/fixtures/toml/template_file.toml
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
[http.routers]
|
||||
{{ range $i, $e := until 20 }}
|
||||
[http.routers.router{{ $e }}]
|
||||
service = "application"
|
||||
{{ end }}
|
|
@ -0,0 +1,5 @@
|
|||
[http.routers]
|
||||
{{ range $i, $e := until 20 }}
|
||||
[http.routers.router{{ $e }}]
|
||||
service = "application"
|
||||
{{ end }}
|
|
@ -0,0 +1,6 @@
|
|||
[http.services]
|
||||
{{ range $i, $e := until 20 }}
|
||||
[http.services.application-{{ $e }}]
|
||||
[[http.services.application-{{ $e }}.servers]]
|
||||
url="http://127.0.0.1"
|
||||
{{ end }}
|
1
pkg/provider/file/fixtures/toml/tls_file.cert
Normal file
1
pkg/provider/file/fixtures/toml/tls_file.cert
Normal file
|
@ -0,0 +1 @@
|
|||
CONTENT
|
6
pkg/provider/file/fixtures/yaml/dir01_file01.yml
Normal file
6
pkg/provider/file/fixtures/yaml/dir01_file01.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
http:
|
||||
routers:
|
||||
router1:
|
||||
service: application-1
|
||||
router2:
|
||||
service: application-2
|
14
pkg/provider/file/fixtures/yaml/dir01_file02.yml
Normal file
14
pkg/provider/file/fixtures/yaml/dir01_file02.yml
Normal file
|
@ -0,0 +1,14 @@
|
|||
http:
|
||||
services:
|
||||
application-1:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.1:80'
|
||||
application-2:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.2:80'
|
||||
application-3:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.3:80'
|
13
pkg/provider/file/fixtures/yaml/dir01_file03.yml
Normal file
13
pkg/provider/file/fixtures/yaml/dir01_file03.yml
Normal file
|
@ -0,0 +1,13 @@
|
|||
tls:
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest1.com.cert
|
||||
keyfile: integration/fixtures/https/snitest1.com.key
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest2.com.cert
|
||||
keyfile: integration/fixtures/https/snitest2.com.key
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest3.com.cert
|
||||
keyfile: integration/fixtures/https/snitest3.com.key
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest4.com.cert
|
||||
keyfile: integration/fixtures/https/snitest4.com.key
|
50
pkg/provider/file/fixtures/yaml/simple_file_01.yml
Normal file
50
pkg/provider/file/fixtures/yaml/simple_file_01.yml
Normal file
|
@ -0,0 +1,50 @@
|
|||
http:
|
||||
routers:
|
||||
router1:
|
||||
service: application-1
|
||||
router2:
|
||||
service: application-2
|
||||
router3:
|
||||
service: application-3
|
||||
services:
|
||||
application-1:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.1:80'
|
||||
application-2:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.2:80'
|
||||
application-3:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.3:80'
|
||||
application-4:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.4:80'
|
||||
application-5:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.5:80'
|
||||
application-6:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.6:80'
|
||||
|
||||
tls:
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest1.com.cert
|
||||
keyfile: integration/fixtures/https/snitest1.com.key
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest2.com.cert
|
||||
keyfile: integration/fixtures/https/snitest2.com.key
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest3.com.cert
|
||||
keyfile: integration/fixtures/https/snitest3.com.key
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest4.com.cert
|
||||
keyfile: integration/fixtures/https/snitest4.com.key
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest5.com.cert
|
||||
keyfile: integration/fixtures/https/snitest5.com.key
|
58
pkg/provider/file/fixtures/yaml/simple_file_02.yml
Normal file
58
pkg/provider/file/fixtures/yaml/simple_file_02.yml
Normal file
|
@ -0,0 +1,58 @@
|
|||
http:
|
||||
routers:
|
||||
router1:
|
||||
service: application-1
|
||||
router2:
|
||||
service: application-2
|
||||
router3:
|
||||
service: application-3
|
||||
router4:
|
||||
service: application-4
|
||||
services:
|
||||
application-1:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.1:80'
|
||||
application-2:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.2:80'
|
||||
application-3:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.3:80'
|
||||
application-4:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.4:80'
|
||||
application-5:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.5:80'
|
||||
application-6:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.6:80'
|
||||
application-7:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.7:80'
|
||||
application-8:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.8:80'
|
||||
|
||||
tls:
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest1.com.cert
|
||||
keyfile: integration/fixtures/https/snitest1.com.key
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest2.com.cert
|
||||
keyfile: integration/fixtures/https/snitest2.com.key
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest3.com.cert
|
||||
keyfile: integration/fixtures/https/snitest3.com.key
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest4.com.cert
|
||||
keyfile: integration/fixtures/https/snitest4.com.key
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
log:
|
||||
level: DEBUG
|
35
pkg/provider/file/fixtures/yaml/simple_traefik_file_02.yml
Normal file
35
pkg/provider/file/fixtures/yaml/simple_traefik_file_02.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
providers:
|
||||
file: {}
|
||||
http:
|
||||
routers:
|
||||
router1:
|
||||
service: application-1
|
||||
router2:
|
||||
service: application-2
|
||||
services:
|
||||
application-1:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.1:80'
|
||||
application-2:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.2:80'
|
||||
application-3:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://172.17.0.3:80'
|
||||
|
||||
tls:
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest1.com.cert
|
||||
keyfile: integration/fixtures/https/snitest1.com.key
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest2.com.cert
|
||||
keyfile: integration/fixtures/https/snitest2.com.key
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest3.com.cert
|
||||
keyfile: integration/fixtures/https/snitest3.com.key
|
||||
- certificate:
|
||||
certfile: integration/fixtures/https/snitest4.com.cert
|
||||
keyfile: integration/fixtures/https/snitest4.com.key
|
6
pkg/provider/file/fixtures/yaml/template_file.yml
Normal file
6
pkg/provider/file/fixtures/yaml/template_file.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
http:
|
||||
{{ range $i, $e := until 20 }}
|
||||
routers:
|
||||
router{{ $e }}:
|
||||
service: application-1
|
||||
{{ end }}
|
|
@ -0,0 +1,6 @@
|
|||
http:
|
||||
{{ range $i, $e := until 20 }}
|
||||
routers:
|
||||
router{{ $e }}:
|
||||
service: application-1
|
||||
{{ end }}
|
|
@ -0,0 +1,8 @@
|
|||
http:
|
||||
services:
|
||||
{{ range $i, $e := until 20 }}
|
||||
application-{{ $e }}:
|
||||
loadbalancer:
|
||||
servers:
|
||||
- url: 'http://127.0.0.1'
|
||||
{{ end }}
|
1
pkg/provider/file/fixtures/yaml/tls_file.cert
Normal file
1
pkg/provider/file/fixtures/yaml/tls_file.cert
Normal file
|
@ -0,0 +1 @@
|
|||
CONTENT
|
Loading…
Add table
Add a link
Reference in a new issue