Skip to content

Commit

Permalink
clustermesh enable: add enable-kvstoremesh flag
Browse files Browse the repository at this point in the history
This commit extends the `cilium clustermesh enable` command with a new
flag which can be used to enable kvstoremesh (cilium/cilium#26083). The
new flag is supported only when using the new Helm mode, and requires
cilium >= 1.14 (it has no effect on earlier versions).

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
  • Loading branch information
giorio94 authored and michi-covalent committed Jun 21, 2023
1 parent c54626e commit 8882712
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions clustermesh/clustermesh.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,10 @@ type Parameters struct {
// EnableExternalWorkloads indicates whether externalWorkloads.enabled Helm value
// should be set to true. For Helm mode only.
EnableExternalWorkloads bool

// EnableKVStoreMesh indicates whether kvstoremesh should be enabled.
// For Helm mode only.
EnableKVStoreMesh bool
}

func (p Parameters) validateParams() error {
Expand Down Expand Up @@ -1901,6 +1905,11 @@ func generateEnableHelmValues(params Parameters, flavor k8s.Flavor) (map[string]
},
}

helmVals["clustermesh"].(map[string]interface{})["apiserver"].(map[string]interface{})["kvstoremesh"] =
map[string]interface{}{
"enabled": params.EnableKVStoreMesh,
}

return helmVals, nil
}

Expand Down
1 change: 1 addition & 0 deletions internal/cli/cmd/clustermesh.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ func newCmdClusterMeshEnableWithHelm() *cobra.Command {
}

cmd.Flags().BoolVar(&params.EnableExternalWorkloads, "enable-external-workloads", false, "Enable support for external workloads, such as VMs")
cmd.Flags().BoolVar(&params.EnableKVStoreMesh, "enable-kvstoremesh", false, "Enable kvstoremesh, an extension which caches remote cluster information in the local kvstore (Cilium >=1.14 only)")
cmd.Flags().StringVar(&params.ServiceType, "service-type", "", "Type of Kubernetes service to expose control plane { LoadBalancer | NodePort | ClusterIP }")

return cmd
Expand Down

0 comments on commit 8882712

Please sign in to comment.