mirror of
https://github.com/siderolabs/talos.git
synced 2026-05-05 04:16:21 +02:00
chore: make qemu lb address bind work on darwin
The loadbalancer is bound to all interfaces on macos. The bridge interface address is not used as the bridge is not yet created at this stage. Multiple loadbalancers can be assigned via different ports. Signed-off-by: Orzelius <33936483+Orzelius@users.noreply.github.com>
This commit is contained in:
parent
97ceab001c
commit
ab7e693d76
@ -38,7 +38,7 @@ func (p *Provisioner) CreateLoadBalancer(state *State, clusterReq provision.Clus
|
||||
|
||||
args := []string{
|
||||
"loadbalancer-launch",
|
||||
"--loadbalancer-addr", clusterReq.Network.GatewayAddrs[0].String(),
|
||||
"--loadbalancer-addr", getLbBindIP(clusterReq.Network.GatewayAddrs[0]),
|
||||
"--loadbalancer-upstreams", strings.Join(controlPlaneIPs, ","),
|
||||
}
|
||||
|
||||
|
||||
14
pkg/provision/providers/vm/loadbalancer_darwin.go
Normal file
14
pkg/provision/providers/vm/loadbalancer_darwin.go
Normal file
@ -0,0 +1,14 @@
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
package vm
|
||||
|
||||
import "net/netip"
|
||||
|
||||
// getLbBindIP returns the 0.0.0.0 address to bind to all interfaces on macos.
|
||||
// The bridge interface address is not used as the bridge is not yet created at this stage.
|
||||
// Multiple loadbalancers can be assigned via different ports.
|
||||
func getLbBindIP(_ netip.Addr) string {
|
||||
return "0.0.0.0"
|
||||
}
|
||||
12
pkg/provision/providers/vm/loadbalancer_linux.go
Normal file
12
pkg/provision/providers/vm/loadbalancer_linux.go
Normal file
@ -0,0 +1,12 @@
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
package vm
|
||||
|
||||
import "net/netip"
|
||||
|
||||
// getLbBindIP returns the gateway address to bind the loadbalancer to the bridge interface.
|
||||
func getLbBindIP(gateway netip.Addr) string {
|
||||
return gateway.String()
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user