
Implements-Blueprint: update-k8-to-v1-api Change-Id: Ie34997dc2aef87226459fa67640e39c08cca0ddf
21 lines
816 B
Cheetah
21 lines
816 B
Cheetah
defaults
|
|
option redispatch
|
|
retries 5
|
|
maxconn 2000
|
|
contimeout 5000
|
|
clitimeout 50000
|
|
srvtimeout 50000
|
|
{{range $svc := ls "/registry/services/endpoints/default"}}
|
|
{{$se := printf "/registry/services/endpoints/default/%s" $svc }}
|
|
{{$ss := printf "/registry/services/specs/default/%s" $svc }}
|
|
{{$seKey := get $se}}{{$ssKey := get $ss}}{{$seJson := json $seKey.Value}}
|
|
{{$ssJson := json $ssKey.Value}}{{$baseSvc := base $svc}}
|
|
{{if and (ne "kubernetes" $baseSvc) (ne "kubernetes-ro" $baseSvc)}}{{range $port := $ssJson.spec.ports}}
|
|
listen {{$baseSvc}}-{{$port.port}} 0.0.0.0:{{$port.port}}
|
|
mode tcp
|
|
balance leastconn
|
|
{{range $subset := $seJson.subsets}}{{range $index, $endpoint := $subset.addresses}}
|
|
server srv{{$index}} {{$endpoint.ip}}:{{$port.targetPort}}{{end}}{{end}}
|
|
|
|
{{end}}{{end}}{{end}}
|