diff --git a/microcloud/cmd/microcloud/main_init.go b/microcloud/cmd/microcloud/main_init.go index 83d9650eb..9aba5a6b4 100644 --- a/microcloud/cmd/microcloud/main_init.go +++ b/microcloud/cmd/microcloud/main_init.go @@ -418,10 +418,21 @@ func AddPeers(sh *service.Handler, systems map[string]InitSystem) error { // setupCluster Bootstraps the cluster if necessary, adds all peers to the cluster, and completes any post cluster // configuration. func setupCluster(s *service.Handler, systems map[string]InitSystem) error { - _, bootstrap := systems[s.Name] + bootstapSystem, bootstrap := systems[s.Name] if bootstrap { fmt.Println("Initializing a new cluster") err := s.RunConcurrent(true, false, func(s service.Service) error { + if s.Type() == types.MicroCeph && bootstapSystem.MicroCephNetworkSubnet != "" { + // When choosing a dedicated ceph network, + // make the public and cluster traffic flow through the same interfaces. + microCephBootstrapConf := map[string]string{ + "PublicNet": bootstapSystem.MicroCephNetworkSubnet, + "ClusterNet": bootstapSystem.MicroCephNetworkSubnet, + } + + s.SetConfig(microCephBootstrapConf) + } + err := s.Bootstrap(context.Background()) if err != nil { return fmt.Errorf("Failed to bootstrap local %s: %w", s.Type(), err)