k8s: deploy.swarm-controller.runtime moves the controller between its unit and the cluster
This commit is contained in:
parent
72b437832d
commit
d6f0b07ff1
1 changed files with 407 additions and 89 deletions
|
|
@ -107,9 +107,17 @@ let
|
|||
# `toString` below so an unset `domain` reaches the assertion that names it
|
||||
# instead of failing evaluation first.
|
||||
controllerTcp = swarmCfg.controller.tcp;
|
||||
# In the cluster the listener is the pod's `hostPort` on the node's address.
|
||||
# The name the certificate is verified as stays `tcp.domain`
|
||||
# (`controllerDial`), so the address needs no certificate of its own.
|
||||
controllerAddress =
|
||||
if deployCfg.swarm-controller.runtime == "k8s" then
|
||||
deployCfg.swarm-controller.tcp.hostAddress
|
||||
else
|
||||
toString controllerTcp.domain;
|
||||
controllerUpstream =
|
||||
if controllerTcp.enable then
|
||||
"https://${toString controllerTcp.domain}:${toString controllerTcp.port}"
|
||||
"https://${controllerAddress}:${toString controllerTcp.port}"
|
||||
else
|
||||
"http://unix:${deployCfg.swarm-controller.socketPath}:";
|
||||
# `proxy_http_version` and `Connection` because `recommendedProxySettings`,
|
||||
|
|
|
|||
Loading…
Reference in a new issue