
This patch introduces kubernetes-dashboard addon to k8s murano application. By default this option is enabled, but user can disable it in dynamic UI corresponding form Co-Authored-By: ddovbii <ddovbii@mirantis.com> Change-Id: Id03aed1c5e3c356421beef7b5110d03c2f07d47d
37 lines
1.5 KiB
Cheetah
37 lines
1.5 KiB
Cheetah
defaults
|
|
option redispatch
|
|
retries 5
|
|
maxconn 2000
|
|
contimeout 5000
|
|
clitimeout 50000
|
|
srvtimeout 50000
|
|
|
|
#Template for kubernetes-dashboard addon
|
|
{{$svc := "/registry/services/endpoints/kube-system/kubernetes-dashboard"}}
|
|
{{if exists $svc}}
|
|
{{$uiEndpoint := get $svc}}
|
|
{{$uiSpec := get "/registry/services/specs/kube-system/kubernetes-dashboard"}}
|
|
{{$uiEndpointJson := json $uiEndpoint.Value}}{{$uiSpecJson := json $uiSpec.Value}}
|
|
{{range $port := $uiSpecJson.spec.ports}}
|
|
listen kubernetes-dashboard-{{$port.port}} 0.0.0.0:{{$port.port}}
|
|
mode tcp
|
|
balance leastconn
|
|
{{range $subset := $uiEndpointJson.subsets}}{{range $index, $endpoint := $subset.addresses}}
|
|
server srv{{$index}} {{$endpoint.ip}}:{{$port.targetPort}}
|
|
{{end}}{{end}}{{end}}{{end}}
|
|
|
|
#Template for the rest of services located in default namespace
|
|
{{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}}
|