@@ -281,19 +281,65 @@ const (
281281 FeatureGateModeTypeDisable FeatureGateModeType = "Disable"
282282)
283283
284+ // DefaultClusterManagerConfiguration represents customized configurations for clustermanager in the Default mode.
285+ type DefaultClusterManagerConfiguration struct {
286+ // RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration.
287+ // +optional
288+ RegistrationWebhookConfiguration DefaultWebhookConfiguration `json:"registrationWebhookConfiguration,omitempty"`
289+
290+ // WorkWebhookConfiguration represents the customized webhook-server configuration of work.
291+ // +optional
292+ WorkWebhookConfiguration DefaultWebhookConfiguration `json:"workWebhookConfiguration,omitempty"`
293+ }
294+
284295// HostedClusterManagerConfiguration represents customized configurations we need to set for clustermanager in the Hosted mode.
285296type HostedClusterManagerConfiguration struct {
286297 // RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration.
287298 // +optional
288- RegistrationWebhookConfiguration WebhookConfiguration `json:"registrationWebhookConfiguration,omitempty"`
299+ RegistrationWebhookConfiguration HostedWebhookConfiguration `json:"registrationWebhookConfiguration,omitempty"`
289300
290301 // WorkWebhookConfiguration represents the customized webhook-server configuration of work.
291302 // +optional
292- WorkWebhookConfiguration WebhookConfiguration `json:"workWebhookConfiguration,omitempty"`
303+ WorkWebhookConfiguration HostedWebhookConfiguration `json:"workWebhookConfiguration,omitempty"`
293304}
294305
295- // WebhookConfiguration has two properties: Address and Port.
296- type WebhookConfiguration struct {
306+ // BindConfiguration represents customization of server bindings
307+ type BindConfiguration struct {
308+ // Port represents the primary bind port of a server. The default value is 9443.
309+ // +optional
310+ // +kubebuilder:default=9443
311+ // +kubebuilder:validation:Maximum=65535
312+ Port int32 `json:"port,omitempty"`
313+
314+ // HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
315+ // Healthchecks may be disabled by setting a value less than or equal to 0.
316+ // +optional
317+ // +kubebuilder:default=8000
318+ // +kubebuilder:validation:Maximum=65535
319+ HealthProbePort int32 `json:"healthProbePort"`
320+
321+ // MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
322+ // Metrics may be disabled by setting a value less than or equal to 0.
323+ // +optional
324+ // +kubebuilder:default=8080
325+ // +kubebuilder:validation:Maximum=65535
326+ MetricsPort int32 `json:"metricsPort"`
327+
328+ // HostNetwork enables running webhook pods in host networking mode.
329+ // This may be required in some installations, such as EKS with Calico CNI,
330+ // to allow the API Server to communicate with the webhook pods.
331+ // +optional
332+ HostNetwork bool `json:"hostNetwork,omitempty"`
333+ }
334+
335+ // DefaultWebhookConfiguration represents customization of webhook servers running in default installation mode
336+ type DefaultWebhookConfiguration struct {
337+ // BindConfiguration represents server bind configuration for the webhook server
338+ BindConfiguration * BindConfiguration `json:"bindConfiguration,omitempty"`
339+ }
340+
341+ // HostedWebhookConfiguration represents customization of webhook servers running in hosted installation mode
342+ type HostedWebhookConfiguration struct {
297343 // Address represents the address of a webhook-server.
298344 // It could be in IP format or fqdn format.
299345 // The Address must be reachable by apiserver of the hub cluster.
@@ -302,11 +348,14 @@ type WebhookConfiguration struct {
302348 // +kubebuilder:validation:Pattern=^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$
303349 Address string `json:"address"`
304350
305- // Port represents the port of a webhook-server. The default value of Port is 443.
351+ // Port represents the external port of a webhook-server. The default value of Port is 443.
306352 // +optional
307353 // +kubebuilder:default=443
308354 // +kubebuilder:validation:Maximum=65535
309355 Port int32 `json:"port,omitempty"`
356+
357+ // BindConfiguration represents server bind configuration for the webhook server
358+ BindConfiguration * BindConfiguration `json:"bindConfiguration,omitempty"`
310359}
311360
312361// ClusterManagerDeployOption describes the deployment options for cluster-manager
@@ -323,6 +372,10 @@ type ClusterManagerDeployOption struct {
323372 // +kubebuilder:validation:Enum=Default;Hosted
324373 Mode InstallMode `json:"mode,omitempty"`
325374
375+ // Default includes optional configurations for clustermanager in the Default mode.
376+ // +optional
377+ Default * DefaultClusterManagerConfiguration `json:"default,omitempty"`
378+
326379 // Hosted includes configurations we need for clustermanager in the Hosted mode.
327380 // +optional
328381 Hosted * HostedClusterManagerConfiguration `json:"hosted,omitempty"`
0 commit comments