traefik/templates/kubernetes.tmpl

141 lines
4.7 KiB
Cheetah
Raw Normal View History

2017-12-16 15:14:19 +00:00
[backends]
{{range $backendName, $backend := .Backends}}
[backends."{{$backendName}}"]
{{if $backend.CircuitBreaker}}
2017-12-16 15:14:19 +00:00
[backends."{{$backendName}}".circuitBreaker]
expression = "{{$backend.CircuitBreaker.Expression}}"
{{end}}
2017-12-16 15:14:19 +00:00
[backends."{{$backendName}}".loadBalancer]
method = "{{$backend.LoadBalancer.Method}}"
2017-10-16 15:38:03 +00:00
{{if $backend.LoadBalancer.Sticky}}
sticky = true
{{end}}
2017-10-10 09:10:02 +00:00
{{if $backend.LoadBalancer.Stickiness}}
2017-12-16 15:14:19 +00:00
[backends."{{$backendName}}".loadBalancer.stickiness]
2017-10-12 15:50:03 +00:00
cookieName = "{{$backend.LoadBalancer.Stickiness.CookieName}}"
{{end}}
2018-01-31 14:32:04 +00:00
{{if $backend.Buffering }}
[backends."{{ $backendName }}".buffering]
maxRequestBodyBytes = {{ $backend.Buffering.MaxRequestBodyBytes }}
memRequestBodyBytes = {{ $backend.Buffering.MemRequestBodyBytes }}
maxResponseBodyBytes = {{ $backend.Buffering.MaxResponseBodyBytes }}
memResponseBodyBytes = {{ $backend.Buffering.MemResponseBodyBytes }}
retryExpression = "{{ $backend.Buffering.RetryExpression }}"
{{end}}
{{range $serverName, $server := $backend.Servers}}
[backends."{{$backendName}}".servers."{{$serverName}}"]
2017-12-16 15:14:19 +00:00
url = "{{$server.URL}}"
weight = {{$server.Weight}}
{{end}}
2017-12-16 15:14:19 +00:00
{{end}}
2017-12-16 15:14:19 +00:00
[frontends]
{{range $frontendName, $frontend := .Frontends}}
[frontends."{{$frontendName}}"]
2017-12-16 15:14:19 +00:00
backend = "{{$frontend.Backend}}"
priority = {{$frontend.Priority}}
passHostHeader = {{$frontend.PassHostHeader}}
2017-12-21 14:54:27 +00:00
passTLSCert = {{$frontend.PassTLSCert}}
2017-12-16 15:14:19 +00:00
entryPoints = [{{range $frontend.EntryPoints}}
2017-04-23 14:17:20 +00:00
"{{.}}",
2017-12-16 15:14:19 +00:00
{{end}}]
2017-12-15 10:48:03 +00:00
2017-12-16 15:14:19 +00:00
basicAuth = [{{range $frontend.BasicAuth}}
"{{.}}",
{{end}}]
whitelistSourceRange = [{{range $frontend.WhitelistSourceRange}}
"{{.}}",
{{end}}]
{{if $frontend.Redirect}}
[frontends."{{$frontendName}}".redirect]
entryPoint = "{{$frontend.RedirectEntryPoint}}"
regex = "{{$frontend.RedirectRegex}}"
replacement = "{{$frontend.RedirectReplacement}}"
{{end}}
2017-12-15 10:48:03 +00:00
{{ if $frontend.Errors }}
[frontends."frontend-{{$frontendName}}".errors]
{{ range $pageName, $page := $frontend.Errors }}
[frontends."frontend-{{$frontendName}}".errors.{{ $pageName }}]
status = [{{range $page.Status}}
"{{.}}",
{{end}}]
backend = "{{$page.Backend}}"
query = "{{$page.Query}}"
{{end}}
{{end}}
2018-01-02 13:49:11 +00:00
{{if $frontend.Headers }}
2017-11-28 12:36:03 +00:00
[frontends."{{$frontendName}}".headers]
2017-12-16 15:14:19 +00:00
SSLRedirect = {{$frontend.Headers.SSLRedirect}}
SSLTemporaryRedirect = {{$frontend.Headers.SSLTemporaryRedirect}}
SSLHost = "{{$frontend.Headers.SSLHost}}"
STSSeconds = {{$frontend.Headers.STSSeconds}}
STSIncludeSubdomains = {{$frontend.Headers.STSIncludeSubdomains}}
STSPreload = {{$frontend.Headers.STSPreload}}
ForceSTSHeader = {{$frontend.Headers.ForceSTSHeader}}
FrameDeny = {{$frontend.Headers.FrameDeny}}
CustomFrameOptionsValue = "{{$frontend.Headers.CustomFrameOptionsValue}}"
ContentTypeNosniff = {{$frontend.Headers.ContentTypeNosniff}}
BrowserXSSFilter = {{$frontend.Headers.BrowserXSSFilter}}
ContentSecurityPolicy = "{{$frontend.Headers.ContentSecurityPolicy}}"
PublicKey = "{{$frontend.Headers.PublicKey}}"
ReferrerPolicy = "{{$frontend.Headers.ReferrerPolicy}}"
IsDevelopment = {{$frontend.Headers.IsDevelopment}}
{{if $frontend.Headers.AllowedHosts}}
AllowedHosts = [{{range $frontend.Headers.AllowedHosts}}
"{{.}}",
{{end}}]
{{end}}
{{if $frontend.Headers.HostsProxyHeaders}}
HostsProxyHeaders = [{{range $frontend.Headers.HostsProxyHeaders}}
"{{.}}",
{{end}}]
{{end}}
{{if $frontend.Headers.CustomRequestHeaders}}
2017-11-28 12:36:03 +00:00
[frontends."{{$frontendName}}".headers.customrequestheaders]
2017-12-16 15:14:19 +00:00
{{range $k, $v := $frontend.Headers.CustomRequestHeaders}}
{{$k}} = "{{$v}}"
{{end}}
2017-11-28 12:36:03 +00:00
{{end}}
2017-12-16 15:14:19 +00:00
{{if $frontend.Headers.CustomResponseHeaders}}
2017-11-28 12:36:03 +00:00
[frontends."{{$frontendName}}".headers.customresponseheaders]
2017-12-16 15:14:19 +00:00
{{range $k, $v := $frontend.Headers.CustomResponseHeaders}}
{{$k}} = "{{$v}}"
{{end}}
2017-11-28 12:36:03 +00:00
{{end}}
2017-12-16 15:14:19 +00:00
{{if $frontend.Headers.SSLProxyHeaders}}
2017-11-28 12:36:03 +00:00
[frontends."{{$frontendName}}".headers.SSLProxyHeaders]
2017-12-16 15:14:19 +00:00
{{range $k, $v := $frontend.Headers.SSLProxyHeaders}}
{{$k}} = "{{$v}}"
{{end}}
2017-11-28 12:36:03 +00:00
{{end}}
2017-12-16 15:14:19 +00:00
{{end}}
{{range $routeName, $route := $frontend.Routes}}
[frontends."{{$frontendName}}".routes."{{$routeName}}"]
2017-12-16 15:14:19 +00:00
rule = "{{$route.Rule}}"
{{end}}
2017-12-16 15:14:19 +00:00
{{end}}
2017-12-16 15:14:19 +00:00
{{range $tls := .TLS }}
2018-01-24 10:57:06 +00:00
[[tls]]
2017-12-16 15:14:19 +00:00
entryPoints = [{{range $tls.EntryPoints }}
"{{.}}",
2017-12-16 15:14:19 +00:00
{{end}}]
2018-01-24 10:57:06 +00:00
[tls.certificate]
2017-12-16 15:14:19 +00:00
certFile = """{{ $tls.Certificate.CertFile }}"""
keyFile = """{{ $tls.Certificate.KeyFile }}"""
{{end}}