feat(ecs): add circuit Breaker label.
This commit is contained in:
parent
07a6d48a27
commit
66f46c5b96
2 changed files with 26 additions and 19 deletions
|
@ -33,6 +33,8 @@ func (p *Provider) buildConfiguration(services map[string][]ecsInstance) (*types
|
||||||
"getHealthCheckPath": getFuncFirstStringValue(label.TraefikBackendHealthCheckPath, ""),
|
"getHealthCheckPath": getFuncFirstStringValue(label.TraefikBackendHealthCheckPath, ""),
|
||||||
"getHealthCheckPort": getFuncFirstIntValue(label.TraefikBackendHealthCheckPort, label.DefaultBackendHealthCheckPort),
|
"getHealthCheckPort": getFuncFirstIntValue(label.TraefikBackendHealthCheckPort, label.DefaultBackendHealthCheckPort),
|
||||||
"getHealthCheckInterval": getFuncFirstStringValue(label.TraefikBackendHealthCheckInterval, ""),
|
"getHealthCheckInterval": getFuncFirstStringValue(label.TraefikBackendHealthCheckInterval, ""),
|
||||||
|
"hasCircuitBreakerLabel": hasFuncFirst(label.TraefikBackendCircuitBreakerExpression),
|
||||||
|
"getCircuitBreakerExpression": getFuncFirstStringValue(label.TraefikBackendCircuitBreakerExpression, label.DefaultCircuitBreakerExpression),
|
||||||
}
|
}
|
||||||
return p.GetConfiguration("templates/ecs.tmpl", ecsFuncMap, struct {
|
return p.GetConfiguration("templates/ecs.tmpl", ecsFuncMap, struct {
|
||||||
Services map[string][]ecsInstance
|
Services map[string][]ecsInstance
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
[backends]
|
[backends]
|
||||||
{{range $serviceName, $instances := .Services}}
|
{{range $serviceName, $instances := .Services}}
|
||||||
|
|
||||||
|
{{if hasCircuitBreakerLabel $instances}}
|
||||||
|
[backends.backend-{{ $serviceName }}.circuitBreaker]
|
||||||
|
expression = "{{getCircuitBreakerExpression $instances}}"
|
||||||
|
{{end}}
|
||||||
|
|
||||||
{{if hasLoadBalancerLabel $instances}}
|
{{if hasLoadBalancerLabel $instances}}
|
||||||
[backends.backend-{{ $serviceName }}.loadBalancer]
|
[backends.backend-{{ $serviceName }}.loadBalancer]
|
||||||
method = "{{ getLoadBalancerMethod $instances}}"
|
method = "{{ getLoadBalancerMethod $instances}}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue