traefik/templates/rancher.tmpl

147 lines
5 KiB
Cheetah
Raw Normal View History

{{$backendServers := .Backends}}
[backends]
{{range $backendName, $backend := .Backends}}
[backends.backend-{{$backendName}}]
{{if hasCircuitBreakerLabel $backend}}
[backends.backend-{{$backendName}}.circuitBreaker]
expression = "{{getCircuitBreakerExpression $backend}}"
{{end}}
{{if hasLoadBalancerLabel $backend}}
[backends.backend-{{$backendName}}.loadBalancer]
method = "{{getLoadBalancerMethod $backend}}"
sticky = {{getSticky $backend}}
{{if hasStickinessLabel $backend}}
[backends.backend-{{$backendName}}.loadBalancer.stickiness]
cookieName = "{{getStickinessCookieName $backend}}"
{{end}}
{{end}}
{{if hasMaxConnLabels $backend}}
[backends.backend-{{$backendName}}.maxConn]
amount = {{getMaxConnAmount $backend}}
extractorFunc = "{{getMaxConnExtractorFunc $backend}}"
{{end}}
2017-12-16 13:21:33 +00:00
{{if hasHealthCheckLabels $backend}}
[backends.backend-{{$backendName}}.healthCheck]
path = "{{getHealthCheckPath $backend}}"
port = {{getHealthCheckPort $backend}}
interval = "{{getHealthCheckInterval $backend}}"
{{end}}
{{range $index, $ip := $backend.Containers}}
[backends.backend-{{$backendName}}.servers.server-{{$index}}]
url = "{{getProtocol $backend}}://{{$ip}}:{{getPort $backend}}"
weight = {{getWeight $backend}}
{{end}}
{{end}}
[frontends]
{{range $frontendName, $service := .Frontends}}
[frontends."frontend-{{$frontendName}}"]
backend = "backend-{{getBackend $service}}"
priority = {{getPriority $service}}
passHostHeader = {{getPassHostHeader $service}}
2017-12-16 13:16:57 +00:00
passTLSCert = {{getPassTLSCert $service}}
entryPoints = [{{range getEntryPoints $service}}
"{{.}}",
{{end}}]
{{if getWhitelistSourceRange $service}}
whitelistSourceRange = [{{range getWhitelistSourceRange $service}}
"{{.}}",
{{end}}]
{{end}}
basicAuth = [{{range getBasicAuth $service}}
"{{.}}",
{{end}}]
2017-12-15 10:48:03 +00:00
{{if hasRedirect $service}}
[frontends."frontend-{{$frontendName}}".redirect]
entryPoint = "{{getRedirectEntryPoint $service}}"
regex = "{{getRedirectRegex $service}}"
replacement = "{{getRedirectReplacement $service}}"
2017-12-15 10:48:03 +00:00
{{end}}
{{ if hasErrorPages $service }}
[frontends."frontend-{{$frontendName}}".errors]
{{ range $pageName, $page := getErrorPages $service }}
[frontends."frontend-{{$frontendName}}".errors.{{ $pageName }}]
status = [{{range $page.Status}}
"{{.}}",
{{end}}]
backend = "{{$page.Backend}}"
query = "{{$page.Query}}"
{{end}}
{{end}}
{{ if hasRateLimits $service }}
[frontends."frontend-{{$frontendName}}".rateLimit]
extractorFunc = "{{ getRateLimitsExtractorFunc $service }}"
[frontends."frontend-{{$frontendName}}".rateLimit.rateSet]
{{ range $limitName, $rateLimit := getRateLimits $service }}
[frontends."frontend-{{$frontendName}}".rateLimit.rateSet.{{ $limitName }}]
period = "{{ $rateLimit.Period }}"
average = {{ $rateLimit.Average }}
burst = {{ $rateLimit.Burst }}
{{end}}
{{end}}
2018-01-02 15:10:37 +00:00
{{if hasHeaders $service }}
[frontends."frontend-{{$frontendName}}".headers]
2018-01-02 15:10:37 +00:00
SSLRedirect = {{getSSLRedirectHeaders $service}}
SSLTemporaryRedirect = {{getSSLTemporaryRedirectHeaders $service}}
SSLHost = "{{getSSLHostHeaders $service}}"
STSSeconds = {{getSTSSecondsHeaders $service}}
STSIncludeSubdomains = {{getSTSIncludeSubdomainsHeaders $service}}
STSPreload = {{getSTSPreloadHeaders $service}}
ForceSTSHeader = {{getForceSTSHeaderHeaders $service}}
FrameDeny = {{getFrameDenyHeaders $service}}
CustomFrameOptionsValue = "{{getCustomFrameOptionsValueHeaders $service}}"
ContentTypeNosniff = {{getContentTypeNosniffHeaders $service}}
BrowserXSSFilter = {{getBrowserXSSFilterHeaders $service}}
ContentSecurityPolicy = "{{getContentSecurityPolicyHeaders $service}}"
PublicKey = "{{getPublicKeyHeaders $service}}"
ReferrerPolicy = "{{getReferrerPolicyHeaders $service}}"
IsDevelopment = {{getIsDevelopmentHeaders $service}}
AllowedHosts = [{{range getAllowedHostsHeaders $service}}
"{{.}}",
{{end}}]
HostsProxyHeaders = [{{range getHostsProxyHeaders $service}}
"{{.}}",
{{end}}]
{{if hasRequestHeaders $service}}
[frontends."frontend-{{$frontendName}}".headers.customRequestHeaders]
{{range $k, $v := getRequestHeaders $service}}
{{$k}} = "{{$v}}"
2017-12-16 13:25:10 +00:00
{{end}}
2018-01-02 15:10:37 +00:00
{{end}}
{{if hasResponseHeaders $service}}
[frontends."frontend-{{$frontendName}}".headers.customResponseHeaders]
{{range $k, $v := getResponseHeaders $service}}
{{$k}} = "{{$v}}"
2017-12-16 13:25:10 +00:00
{{end}}
2018-01-02 15:10:37 +00:00
{{end}}
{{if hasSSLProxyHeaders $service}}
[frontends."frontend-{{$frontendName}}".headers.SSLProxyHeaders]
{{range $k, $v := getSSLProxyHeaders $service}}
{{$k}} = "{{$v}}"
2017-12-16 13:25:10 +00:00
{{end}}
2018-01-02 15:10:37 +00:00
{{end}}
{{end}}
2017-12-16 13:25:10 +00:00
[frontends."frontend-{{$frontendName}}".routes."route-frontend-{{$frontendName}}"]
rule = "{{getFrontendRule $service}}"
{{end}}