Skip to content

Commit ffa7865

Browse files
committed
Configuration options for webhooks running in hub cluster
Signed-off-by: Ben Perry <[email protected]>
1 parent ade1c7c commit ffa7865

File tree

4 files changed

+172
-3
lines changed

4 files changed

+172
-3
lines changed

operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,71 @@ spec:
9191
DeployOption contains the options of deploying a cluster-manager
9292
Default mode is used if DeployOption is not set.
9393
properties:
94+
default:
95+
description: Default includes configurations for clustermanager
96+
in the Default mode
97+
properties:
98+
registrationWebhookConfiguration:
99+
description: RegistrationWebhookConfiguration represents the
100+
customized webhook-server configuration of registration.
101+
properties:
102+
healthProbeBindAddress:
103+
default: :8000
104+
description: |-
105+
HealthProbeBindAddress represents the healthcheck address of a webhook-server. The default value is ":8000".
106+
Healthchecks may be disabled by setting a value of "0" or "".
107+
type: string
108+
hostNetwork:
109+
description: |-
110+
HostNetwork enables running webhook pods with hostNetwork: true
111+
This may be required in some installations, such as EKS with Calico CNI,
112+
to allow the API Server to communicate with the webhook pods.
113+
type: boolean
114+
metricsBindAddress:
115+
default: :8080
116+
description: |-
117+
MetricsBindAddress represents the metrics address of a webhook-server. The default value is ":8080"
118+
Metrics may be disabled by setting a value of "0" or "".
119+
type: string
120+
port:
121+
default: 9443
122+
description: Port represents the port of a webhook-server.
123+
The default value of Port is 9443.
124+
format: int32
125+
maximum: 65535
126+
type: integer
127+
type: object
128+
workWebhookConfiguration:
129+
description: WorkWebhookConfiguration represents the customized
130+
webhook-server configuration of work.
131+
properties:
132+
healthProbeBindAddress:
133+
default: :8000
134+
description: |-
135+
HealthProbeBindAddress represents the healthcheck address of a webhook-server. The default value is ":8000".
136+
Healthchecks may be disabled by setting a value of "0" or "".
137+
type: string
138+
hostNetwork:
139+
description: |-
140+
HostNetwork enables running webhook pods with hostNetwork: true
141+
This may be required in some installations, such as EKS with Calico CNI,
142+
to allow the API Server to communicate with the webhook pods.
143+
type: boolean
144+
metricsBindAddress:
145+
default: :8080
146+
description: |-
147+
MetricsBindAddress represents the metrics address of a webhook-server. The default value is ":8080"
148+
Metrics may be disabled by setting a value of "0" or "".
149+
type: string
150+
port:
151+
default: 9443
152+
description: Port represents the port of a webhook-server.
153+
The default value of Port is 9443.
154+
format: int32
155+
maximum: 65535
156+
type: integer
157+
type: object
158+
type: object
94159
hosted:
95160
description: Hosted includes configurations we need for clustermanager
96161
in the Hosted mode.

operator/v1/types_clustermanager.go

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,17 @@ const (
232232
FeatureGateModeTypeDisable FeatureGateModeType = "Disable"
233233
)
234234

235+
// DefaultClusterManagerConfiguration represents customized configurations for clustermanager in the Default mode
236+
type DefaultClusterManagerConfiguration struct {
237+
// RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration.
238+
// +optional
239+
RegistrationWebhookConfiguration WebhookDefaultConfiguration `json:"registrationWebhookConfiguration,omitempty"`
240+
241+
// WorkWebhookConfiguration represents the customized webhook-server configuration of work.
242+
// +optional
243+
WorkWebhookConfiguration WebhookDefaultConfiguration `json:"workWebhookConfiguration,omitempty"`
244+
}
245+
235246
// HostedClusterManagerConfiguration represents customized configurations we need to set for clustermanager in the Hosted mode.
236247
type HostedClusterManagerConfiguration struct {
237248
// RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration.
@@ -243,6 +254,33 @@ type HostedClusterManagerConfiguration struct {
243254
WorkWebhookConfiguration WebhookConfiguration `json:"workWebhookConfiguration,omitempty"`
244255
}
245256

257+
// WebhookDefaultConfiguration represents configuration for webhooks running in "Default" mode in the hub cluster
258+
type WebhookDefaultConfiguration struct {
259+
// Port represents the port of a webhook-server. The default value of Port is 9443.
260+
// +optional
261+
// +kubebuilder:default=9443
262+
// +kubebuilder:validation:Maximum=65535
263+
Port int32 `json:"port,omitempty"`
264+
265+
// HealthProbeBindAddress represents the healthcheck address of a webhook-server. The default value is ":8000".
266+
// Healthchecks may be disabled by setting a value of "0" or "".
267+
// +optional
268+
// +kubebuilder:default=":8000"
269+
HealthProbeBindAddress string `json:"healthProbeBindAddress"`
270+
271+
// MetricsBindAddress represents the metrics address of a webhook-server. The default value is ":8080"
272+
// Metrics may be disabled by setting a value of "0" or "".
273+
// +optional
274+
// +kubebuilder:default=":8080"
275+
MetricsBindAddress string `json:"metricsBindAddress"`
276+
277+
// HostNetwork enables running webhook pods with hostNetwork: true
278+
// This may be required in some installations, such as EKS with Calico CNI,
279+
// to allow the API Server to communicate with the webhook pods.
280+
// +optional
281+
HostNetwork bool `json:"hostNetwork,omitempty"`
282+
}
283+
246284
// WebhookConfiguration has two properties: Address and Port.
247285
type WebhookConfiguration struct {
248286
// Address represents the address of a webhook-server.
@@ -274,6 +312,10 @@ type ClusterManagerDeployOption struct {
274312
// +kubebuilder:validation:Enum=Default;Hosted
275313
Mode InstallMode `json:"mode,omitempty"`
276314

315+
// Default includes configurations for clustermanager in the Default mode
316+
// +optional
317+
Default *DefaultClusterManagerConfiguration `json:"default,omitempty"`
318+
277319
// Hosted includes configurations we need for clustermanager in the Hosted mode.
278320
// +optional
279321
Hosted *HostedClusterManagerConfiguration `json:"hosted,omitempty"`

operator/v1/zz_generated.deepcopy.go

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

operator/v1/zz_generated.swagger_doc_generated.go

Lines changed: 26 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)