1
0
mirror of https://github.com/containous/traefik.git synced 2024-12-24 21:34:39 +03:00
traefik/templates/kubernetes.tmpl

158 lines
5.5 KiB
Cheetah
Raw Normal View History

2017-12-16 18:14:19 +03:00
[backends]
{{range $backendName, $backend := .Backends }}
2017-12-16 18:14:19 +03:00
[backends."{{ $backendName }}"]
2017-12-16 18:14:19 +03:00
{{if $backend.CircuitBreaker }}
[backends."{{ $backendName }} ".circuitBreaker]
expression = "{{ $backend.CircuitBreaker.Expression }}"
{{end}}
2017-12-16 18:14:19 +03:00
[backends."{{ $backendName }}".loadBalancer]
method = "{{ $backend.LoadBalancer.Method }}"
sticky = {{ $backend.LoadBalancer.Sticky }}
{{if $backend.LoadBalancer.Stickiness }}
[backends."{{ $backendName }}".loadBalancer.stickiness]
cookieName = "{{ $backend.LoadBalancer.Stickiness.CookieName }}"
{{end}}
2018-01-31 17:32:04 +03:00
{{if $backend.MaxConn }}
[backends.backend-{{ $backendName }}.maxConn]
2017-12-22 00:44:06 +03:00
amount = {{ $backend.MaxConn.Amount }}
extractorFunc = "{{ $backend.MaxConn.ExtractorFunc }}"
{{end}}
2018-01-31 17:32:04 +03: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 }}"]
url = "{{ $server.URL }}"
weight = {{ $server.Weight }}
{{end}}
2017-12-16 18:14:19 +03:00
{{end}}
2017-12-16 18:14:19 +03:00
[frontends]
{{range $frontendName, $frontend := .Frontends }}
2017-12-16 18:14:19 +03:00
[frontends."{{ $frontendName }}"]
backend = "{{ $frontend.Backend }}"
priority = {{ $frontend.Priority }}
passHostHeader = {{ $frontend.PassHostHeader }}
passTLSCert = {{ $frontend.PassTLSCert }}
2017-12-16 18:14:19 +03:00
entryPoints = [{{range $frontend.EntryPoints }}
2017-04-23 17:17:20 +03:00
"{{.}}",
2017-12-16 18:14:19 +03:00
{{end}}]
2017-12-15 13:48:03 +03:00
basicAuth = [{{range $frontend.BasicAuth }}
2017-12-16 18:14:19 +03:00
"{{.}}",
{{end}}]
whitelistSourceRange = [{{range $frontend.WhitelistSourceRange }}
2017-12-16 18:14:19 +03:00
"{{.}}",
{{end}}]
{{if $frontend.Redirect }}
[frontends."{{ $frontendName }}".redirect]
entryPoint = "{{ $frontend.Redirect.EntryPoint }}"
regex = "{{ $frontend.Redirect.Regex }}"
replacement = "{{ $frontend.Redirect.Replacement }}"
2017-12-16 18:14:19 +03:00
{{end}}
2017-12-15 13:48:03 +03:00
{{if $frontend.Errors }}
[frontends."{{ $frontendName }}".errors]
{{range $pageName, $page := $frontend.Errors }}
[frontends."{{ $frontendName }}".errors.{{ $pageName }}]
status = [{{range $page.Status }}
"{{.}}",
{{end}}]
backend = "{{ $page.Backend }}"
query = "{{ $page.Query }}"
{{end}}
{{end}}
{{if $frontend.RateLimit }}
[frontends."{{ $frontendName }}".rateLimit]
2017-12-22 00:07:37 +03:00
extractorFunc = "{{ $frontend.RateLimit.ExtractorFunc }}"
[frontends."{{ $frontendName }}".rateLimit.rateSet]
{{range $limitName, $limit := $frontend.RateLimit.RateSet }}
[frontends."{{ $frontendName }}".rateLimit.rateSet.{{ $limitName }}]
2017-12-22 00:07:37 +03:00
period = "{{ $limit.Period }}"
average = {{ $limit.Average }}
burst = {{ $limit.Burst }}
{{end}}
{{end}}
2018-01-02 16:49:11 +03:00
{{if $frontend.Headers }}
[frontends."{{ $frontendName }}".headers]
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 }}
2018-03-02 16:24:03 +03:00
CustomBrowserXSSValue = "{{ $frontend.Headers.CustomBrowserXSSValue }}"
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 }}
2017-12-16 18:14:19 +03:00
"{{.}}",
{{end}}]
{{end}}
{{if $frontend.Headers.HostsProxyHeaders }}
HostsProxyHeaders = [{{range $frontend.Headers.HostsProxyHeaders }}
2017-12-16 18:14:19 +03:00
"{{.}}",
{{end}}]
{{end}}
{{if $frontend.Headers.CustomRequestHeaders }}
[frontends."{{ $frontendName }}".headers.customRequestHeaders]
{{range $k, $v := $frontend.Headers.CustomRequestHeaders }}
{{ $k }} = "{{ $v }}"
2017-12-16 18:14:19 +03:00
{{end}}
2017-11-28 15:36:03 +03:00
{{end}}
{{if $frontend.Headers.CustomResponseHeaders }}
[frontends."{{ $frontendName }}".headers.customResponseHeaders]
{{range $k, $v := $frontend.Headers.CustomResponseHeaders }}
{{ $k }} = "{{ $v }}"
2017-12-16 18:14:19 +03:00
{{end}}
2017-11-28 15:36:03 +03:00
{{end}}
{{if $frontend.Headers.SSLProxyHeaders }}
[frontends."{{ $frontendName }}".headers.SSLProxyHeaders]
{{range $k, $v := $frontend.Headers.SSLProxyHeaders }}
{{ $k }} = "{{ $v }}"
2017-12-16 18:14:19 +03:00
{{end}}
2017-11-28 15:36:03 +03:00
{{end}}
2017-12-16 18:14:19 +03:00
{{end}}
{{range $routeName, $route := $frontend.Routes }}
[frontends."{{ $frontendName }}".routes."{{ $routeName }}"]
rule = "{{ $route.Rule }}"
{{end}}
2017-12-16 18:14:19 +03:00
{{end}}
2017-12-16 18:14:19 +03:00
{{range $tls := .TLS }}
2018-01-24 13:57:06 +03:00
[[tls]]
2017-12-16 18:14:19 +03:00
entryPoints = [{{range $tls.EntryPoints }}
"{{.}}",
2017-12-16 18:14:19 +03:00
{{end}}]
2018-01-24 13:57:06 +03:00
[tls.certificate]
2017-12-16 18:14:19 +03:00
certFile = """{{ $tls.Certificate.CertFile }}"""
keyFile = """{{ $tls.Certificate.KeyFile }}"""
{{end}}