Skip to content

Commit

Permalink
microcloud/cmd/microcloud: Apply Ceph dedicated network config to Mic…
Browse files Browse the repository at this point in the history
…roCeph service

If a dedicated Ceph network has been required,
we choose this subnet for the `public` and `cluster` traffic.

Signed-off-by: Gabriel Mougard <[email protected]>
  • Loading branch information
gabrielmougard committed Apr 8, 2024
1 parent 914f464 commit 74679d6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion microcloud/cmd/microcloud/main_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 74679d6

Please sign in to comment.