mirror of
https://github.com/kairos-io/provider-kairos.git
synced 2025-09-16 07:09:20 +00:00
✨ Add HA p2p support
Fixes: https://github.com/kairos-io/kairos/issues/2 Signed-off-by: Ettore Di Giacinto <mudler@mocaccino.org>
This commit is contained in:
@@ -97,18 +97,16 @@ func Bootstrap(e *pluggable.Event) pluggable.EventResponse {
|
||||
return ErrorEvent("No network token provided, exiting")
|
||||
}
|
||||
|
||||
if !providerConfig.Kairos.Hybrid {
|
||||
if !providerConfig.Kairos.Hybrid || providerConfig.Kairos.HybridVPN {
|
||||
logger.Info("Configuring VPN")
|
||||
if err := SetupVPN(services.EdgeVPNDefaultInstance, cfg.APIAddress, "/", true, providerConfig); err != nil {
|
||||
return ErrorEvent("Failed setup VPN: %s", err.Error())
|
||||
}
|
||||
|
||||
} else {
|
||||
logger.Info("Configuring API")
|
||||
if err := SetupAPI(cfg.APIAddress, "/", true, providerConfig); err != nil {
|
||||
return ErrorEvent("Failed setup VPN: %s", err.Error())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
networkID := "kairos"
|
||||
@@ -131,7 +129,15 @@ func Bootstrap(e *pluggable.Event) pluggable.EventResponse {
|
||||
service.WithRoles(
|
||||
service.RoleKey{
|
||||
Role: "master",
|
||||
RoleHandler: p2p.Master(c, providerConfig),
|
||||
RoleHandler: p2p.Master(c, providerConfig, false, false),
|
||||
},
|
||||
service.RoleKey{
|
||||
Role: "master/clusterinit",
|
||||
RoleHandler: p2p.Master(c, providerConfig, true, true),
|
||||
},
|
||||
service.RoleKey{
|
||||
Role: "master/ha",
|
||||
RoleHandler: p2p.Master(c, providerConfig, false, true),
|
||||
},
|
||||
service.RoleKey{
|
||||
Role: "worker",
|
||||
|
Reference in New Issue
Block a user