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 @@ -91,6 +91,89 @@ spec:
DeployOption contains the options of deploying a cluster-manager
Default mode is used if DeployOption is not set.
properties:
default:
description: Default includes optional configurations for clustermanager
in the Default mode.
properties:
registrationWebhookConfiguration:
description: RegistrationWebhookConfiguration represents the
customized webhook-server configuration of registration.
properties:
bindConfiguration:
description: BindConfiguration represents server bind
configuration for the webhook server
properties:
healthProbePort:
default: 8000
description: |-
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
Healthchecks may be disabled by setting a value less than or equal to 0.
format: int32
maximum: 65535
type: integer
hostNetwork:
description: |-
HostNetwork enables running webhook pods in host networking mode.
This may be required in some installations, such as EKS with Calico CNI,
to allow the API Server to communicate with the webhook pods.
type: boolean
metricsPort:
default: 8080
description: |-
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
Metrics may be disabled by setting a value less than or equal to 0.
format: int32
maximum: 65535
type: integer
port:
default: 9443
description: Port represents the primary bind port
of a server. The default value is 9443.
format: int32
maximum: 65535
type: integer
type: object
type: object
workWebhookConfiguration:
description: WorkWebhookConfiguration represents the customized
webhook-server configuration of work.
properties:
bindConfiguration:
description: BindConfiguration represents server bind
configuration for the webhook server
properties:
healthProbePort:
default: 8000
description: |-
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
Healthchecks may be disabled by setting a value less than or equal to 0.
format: int32
maximum: 65535
type: integer
hostNetwork:
description: |-
HostNetwork enables running webhook pods in host networking mode.
This may be required in some installations, such as EKS with Calico CNI,
to allow the API Server to communicate with the webhook pods.
type: boolean
metricsPort:
default: 8080
description: |-
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
Metrics may be disabled by setting a value less than or equal to 0.
format: int32
maximum: 65535
type: integer
port:
default: 9443
description: Port represents the primary bind port
of a server. The default value is 9443.
format: int32
maximum: 65535
type: integer
type: object
type: object
type: object
hosted:
description: Hosted includes configurations we need for clustermanager
in the Hosted mode.
Expand All @@ -106,9 +189,43 @@ spec:
The Address must be reachable by apiserver of the hub cluster.
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])$
type: string
bindConfiguration:
description: BindConfiguration represents server bind
configuration for the webhook server
properties:
healthProbePort:
default: 8000
description: |-
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
Healthchecks may be disabled by setting a value less than or equal to 0.
format: int32
maximum: 65535
type: integer
hostNetwork:
description: |-
HostNetwork enables running webhook pods in host networking mode.
This may be required in some installations, such as EKS with Calico CNI,
to allow the API Server to communicate with the webhook pods.
type: boolean
metricsPort:
default: 8080
description: |-
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
Metrics may be disabled by setting a value less than or equal to 0.
format: int32
maximum: 65535
type: integer
port:
default: 9443
description: Port represents the primary bind port
of a server. The default value is 9443.
format: int32
maximum: 65535
type: integer
type: object
port:
default: 443
description: Port represents the port of a webhook-server.
description: Port represents the external port of a webhook-server.
The default value of Port is 443.
format: int32
maximum: 65535
Expand All @@ -127,9 +244,43 @@ spec:
The Address must be reachable by apiserver of the hub cluster.
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])$
type: string
bindConfiguration:
description: BindConfiguration represents server bind
configuration for the webhook server
properties:
healthProbePort:
default: 8000
description: |-
HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
Healthchecks may be disabled by setting a value less than or equal to 0.
format: int32
maximum: 65535
type: integer
hostNetwork:
description: |-
HostNetwork enables running webhook pods in host networking mode.
This may be required in some installations, such as EKS with Calico CNI,
to allow the API Server to communicate with the webhook pods.
type: boolean
metricsPort:
default: 8080
description: |-
MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
Metrics may be disabled by setting a value less than or equal to 0.
format: int32
maximum: 65535
type: integer
port:
default: 9443
description: Port represents the primary bind port
of a server. The default value is 9443.
format: int32
maximum: 65535
type: integer
type: object
port:
default: 443
description: Port represents the port of a webhook-server.
description: Port represents the external port of a webhook-server.
The default value of Port is 443.
format: int32
maximum: 65535
Expand Down
63 changes: 58 additions & 5 deletions operator/v1/types_clustermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,19 +281,65 @@ const (
FeatureGateModeTypeDisable FeatureGateModeType = "Disable"
)

// DefaultClusterManagerConfiguration represents customized configurations for clustermanager in the Default mode.
type DefaultClusterManagerConfiguration struct {
// RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration.
// +optional
RegistrationWebhookConfiguration DefaultWebhookConfiguration `json:"registrationWebhookConfiguration,omitempty"`

// WorkWebhookConfiguration represents the customized webhook-server configuration of work.
// +optional
WorkWebhookConfiguration DefaultWebhookConfiguration `json:"workWebhookConfiguration,omitempty"`
}

// HostedClusterManagerConfiguration represents customized configurations we need to set for clustermanager in the Hosted mode.
type HostedClusterManagerConfiguration struct {
// RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration.
// +optional
RegistrationWebhookConfiguration WebhookConfiguration `json:"registrationWebhookConfiguration,omitempty"`
RegistrationWebhookConfiguration HostedWebhookConfiguration `json:"registrationWebhookConfiguration,omitempty"`

// WorkWebhookConfiguration represents the customized webhook-server configuration of work.
// +optional
WorkWebhookConfiguration WebhookConfiguration `json:"workWebhookConfiguration,omitempty"`
WorkWebhookConfiguration HostedWebhookConfiguration `json:"workWebhookConfiguration,omitempty"`
}

// WebhookConfiguration has two properties: Address and Port.
type WebhookConfiguration struct {
// BindConfiguration represents customization of server bindings
type BindConfiguration struct {
// Port represents the primary bind port of a server. The default value is 9443.
// +optional
// +kubebuilder:default=9443
// +kubebuilder:validation:Maximum=65535
Port int32 `json:"port,omitempty"`

// HealthProbePort represents the bind port of a webhook-server's healthcheck endpoint. The default value is 8000.
// Healthchecks may be disabled by setting a value less than or equal to 0.
// +optional
// +kubebuilder:default=8000
// +kubebuilder:validation:Maximum=65535
HealthProbePort int32 `json:"healthProbePort"`

// MetricsPort represents the bind port for a webhook-server's metric endpoint. The default value is 8080.
// Metrics may be disabled by setting a value less than or equal to 0.
// +optional
// +kubebuilder:default=8080
// +kubebuilder:validation:Maximum=65535
MetricsPort int32 `json:"metricsPort"`

// HostNetwork enables running webhook pods in host networking mode.
// This may be required in some installations, such as EKS with Calico CNI,
// to allow the API Server to communicate with the webhook pods.
// +optional
HostNetwork bool `json:"hostNetwork,omitempty"`
}

// DefaultWebhookConfiguration represents customization of webhook servers running in default installation mode
type DefaultWebhookConfiguration struct {
// BindConfiguration represents server bind configuration for the webhook server
BindConfiguration *BindConfiguration `json:"bindConfiguration,omitempty"`
}

// HostedWebhookConfiguration represents customization of webhook servers running in hosted installation mode
type HostedWebhookConfiguration struct {
// Address represents the address of a webhook-server.
// It could be in IP format or fqdn format.
// The Address must be reachable by apiserver of the hub cluster.
Expand All @@ -302,11 +348,14 @@ type WebhookConfiguration struct {
// +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])$
Address string `json:"address"`

// Port represents the port of a webhook-server. The default value of Port is 443.
// Port represents the external port of a webhook-server. The default value of Port is 443.
// +optional
// +kubebuilder:default=443
// +kubebuilder:validation:Maximum=65535
Port int32 `json:"port,omitempty"`

// BindConfiguration represents server bind configuration for the webhook server
BindConfiguration *BindConfiguration `json:"bindConfiguration,omitempty"`
}

// ClusterManagerDeployOption describes the deployment options for cluster-manager
Expand All @@ -323,6 +372,10 @@ type ClusterManagerDeployOption struct {
// +kubebuilder:validation:Enum=Default;Hosted
Mode InstallMode `json:"mode,omitempty"`

// Default includes optional configurations for clustermanager in the Default mode.
// +optional
Default *DefaultClusterManagerConfiguration `json:"default,omitempty"`

// Hosted includes configurations we need for clustermanager in the Hosted mode.
// +optional
Hosted *HostedClusterManagerConfiguration `json:"hosted,omitempty"`
Expand Down
Loading