Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,8 @@ spec:
addOnManagerConfiguration:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.clusterManager.serverConfiguration }}
serverConfiguration:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
11 changes: 11 additions & 0 deletions deploy/cluster-manager/chart/cluster-manager/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,20 @@ clusterManager:
mode: Enable
registrationDrivers:
- authType: csr
# - authType: grpc
# grpc:
# autoApprovedIdentities:
# - system:serviceaccount:open-cluster-management:agent-registration-bootstrap
workConfiguration:
workDriver: kube
addOnManagerConfiguration: {}
# featureGates:
# - feature: ""
# mode: ""
# serverConfiguration:
# endpointsExposure:
# - protocol: grpc
# grpc:
# type: hostname
# hostname:
# host: grpc-server-open-cluster-management-hub.apps.server-foundation-sno-lite-w8rlq.dev04.red-chesterfield.com
4 changes: 4 additions & 0 deletions pkg/operator/helpers/chart/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ type ClusterManagerConfig struct {
// +optional
AddOnManagerConfiguration operatorv1.AddOnManagerConfiguration `json:"addOnManagerConfiguration,omitempty"`

// ServerConfiguration contains the configuration of http/grpc server.
// +optional
ServerConfiguration operatorv1.ServerConfiguration `json:"serverConfiguration,omitempty"`

// ResourceRequirement specify QoS classes of deployments managed by clustermanager.
// It applies to all the containers in the deployments.
// +optional
Expand Down
38 changes: 38 additions & 0 deletions pkg/operator/helpers/chart/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,36 @@ func TestClusterManagerConfig(t *testing.T) {
},
expectedObjCnt: 9,
},
{
name: "enable grpc ",
namespace: "multicluster-engine",
chartConfig: func() *ClusterManagerChartConfig {
config := NewDefaultClusterManagerChartConfig()
config.CreateBootstrapSA = true
config.ClusterManager.RegistrationConfiguration.RegistrationDrivers = append(
config.ClusterManager.RegistrationConfiguration.RegistrationDrivers, operatorv1.RegistrationDriverHub{
AuthType: "grpc",
GRPC: &operatorv1.GRPCRegistrationConfig{AutoApprovedIdentities: []string{"user:test"}},
})

config.ClusterManager.ServerConfiguration = operatorv1.ServerConfiguration{
EndpointsExposure: []operatorv1.EndpointExposure{
{
Usage: "",
Protocol: "grpc",
GRPC: &operatorv1.Endpoint{
Type: "hostname",
Hostname: &operatorv1.HostnameConfig{
Host: "host.com",
},
},
},
},
}
return config
},
expectedObjCnt: 8,
},
}

for _, c := range cases {
Expand Down Expand Up @@ -202,6 +232,14 @@ func TestClusterManagerConfig(t *testing.T) {
t.Errorf("failed to render auto approve users")
}
}
registrationDrivers := config.ClusterManager.RegistrationConfiguration.RegistrationDrivers
for _, driver := range registrationDrivers {
if driver.AuthType == operatorv1.GRPCAuthType {
if len(config.ClusterManager.ServerConfiguration.EndpointsExposure) == 0 {
t.Errorf("failed to render serverConfiguration")
}
}
}
case *corev1.Secret:
switch object.Name {
case "open-cluster-management-image-pull-credentials":
Expand Down
Loading