Skip to content

Commit 8201fca

Browse files
committed
Shared WebhookConfiguration api for all modes
Signed-off-by: Ben Perry <[email protected]>
1 parent 731dbc4 commit 8201fca

File tree

10 files changed

+251
-127
lines changed

10 files changed

+251
-127
lines changed

deploy/cluster-manager/chart/cluster-manager/crds/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml

Lines changed: 64 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ spec:
9999
description: RegistrationWebhookConfiguration represents the
100100
customized webhook-server configuration of registration.
101101
properties:
102+
address:
103+
description: |-
104+
Address represents the address of a webhook-server.
105+
It could be in IP format or fqdn format.
106+
The Address must be reachable by apiserver of the hub cluster.
107+
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])$
108+
type: string
102109
healthProbeBindAddress:
103110
default: :8000
104111
description: |-
@@ -118,9 +125,9 @@ spec:
118125
Metrics may be disabled by setting a value of "0" or "".
119126
type: string
120127
port:
121-
default: 9443
122128
description: Port represents the port of a webhook-server.
123-
The default value of Port is 9443.
129+
The default value of Port is 9443 in default mode, or
130+
443 in hosted mode.
124131
format: int32
125132
maximum: 65535
126133
type: integer
@@ -129,6 +136,13 @@ spec:
129136
description: WorkWebhookConfiguration represents the customized
130137
webhook-server configuration of work.
131138
properties:
139+
address:
140+
description: |-
141+
Address represents the address of a webhook-server.
142+
It could be in IP format or fqdn format.
143+
The Address must be reachable by apiserver of the hub cluster.
144+
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])$
145+
type: string
132146
healthProbeBindAddress:
133147
default: :8000
134148
description: |-
@@ -148,9 +162,9 @@ spec:
148162
Metrics may be disabled by setting a value of "0" or "".
149163
type: string
150164
port:
151-
default: 9443
152165
description: Port represents the port of a webhook-server.
153-
The default value of Port is 9443.
166+
The default value of Port is 9443 in default mode, or
167+
443 in hosted mode.
154168
format: int32
155169
maximum: 65535
156170
type: integer
@@ -171,16 +185,35 @@ spec:
171185
The Address must be reachable by apiserver of the hub cluster.
172186
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])$
173187
type: string
188+
healthProbeBindAddress:
189+
default: :8000
190+
description: |-
191+
HealthProbeBindAddress represents the healthcheck address of a webhook-server. The default value is ":8000".
192+
Healthchecks may be disabled by setting a value of "0" or "".
193+
type: string
194+
hostNetwork:
195+
description: |-
196+
HostNetwork enables running webhook pods with hostNetwork: true
197+
This may be required in some installations, such as EKS with Calico CNI,
198+
to allow the API Server to communicate with the webhook pods.
199+
type: boolean
200+
metricsBindAddress:
201+
default: :8080
202+
description: |-
203+
MetricsBindAddress represents the metrics address of a webhook-server. The default value is ":8080"
204+
Metrics may be disabled by setting a value of "0" or "".
205+
type: string
174206
port:
175-
default: 443
176207
description: Port represents the port of a webhook-server.
177-
The default value of Port is 443.
208+
The default value of Port is 9443 in default mode, or
209+
443 in hosted mode.
178210
format: int32
179211
maximum: 65535
180212
type: integer
181-
required:
182-
- address
183213
type: object
214+
x-kubernetes-validations:
215+
- message: Address is required for hosted webhook configuration
216+
rule: self.address != ''
184217
workWebhookConfiguration:
185218
description: WorkWebhookConfiguration represents the customized
186219
webhook-server configuration of work.
@@ -192,16 +225,35 @@ spec:
192225
The Address must be reachable by apiserver of the hub cluster.
193226
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])$
194227
type: string
228+
healthProbeBindAddress:
229+
default: :8000
230+
description: |-
231+
HealthProbeBindAddress represents the healthcheck address of a webhook-server. The default value is ":8000".
232+
Healthchecks may be disabled by setting a value of "0" or "".
233+
type: string
234+
hostNetwork:
235+
description: |-
236+
HostNetwork enables running webhook pods with hostNetwork: true
237+
This may be required in some installations, such as EKS with Calico CNI,
238+
to allow the API Server to communicate with the webhook pods.
239+
type: boolean
240+
metricsBindAddress:
241+
default: :8080
242+
description: |-
243+
MetricsBindAddress represents the metrics address of a webhook-server. The default value is ":8080"
244+
Metrics may be disabled by setting a value of "0" or "".
245+
type: string
195246
port:
196-
default: 443
197247
description: Port represents the port of a webhook-server.
198-
The default value of Port is 443.
248+
The default value of Port is 9443 in default mode, or
249+
443 in hosted mode.
199250
format: int32
200251
maximum: 65535
201252
type: integer
202-
required:
203-
- address
204253
type: object
254+
x-kubernetes-validations:
255+
- message: Address is required for hosted webhook configuration
256+
rule: self.address != ''
205257
type: object
206258
mode:
207259
default: Default

deploy/cluster-manager/config/crds/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml

Lines changed: 64 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ spec:
9999
description: RegistrationWebhookConfiguration represents the
100100
customized webhook-server configuration of registration.
101101
properties:
102+
address:
103+
description: |-
104+
Address represents the address of a webhook-server.
105+
It could be in IP format or fqdn format.
106+
The Address must be reachable by apiserver of the hub cluster.
107+
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])$
108+
type: string
102109
healthProbeBindAddress:
103110
default: :8000
104111
description: |-
@@ -118,9 +125,9 @@ spec:
118125
Metrics may be disabled by setting a value of "0" or "".
119126
type: string
120127
port:
121-
default: 9443
122128
description: Port represents the port of a webhook-server.
123-
The default value of Port is 9443.
129+
The default value of Port is 9443 in default mode, or
130+
443 in hosted mode.
124131
format: int32
125132
maximum: 65535
126133
type: integer
@@ -129,6 +136,13 @@ spec:
129136
description: WorkWebhookConfiguration represents the customized
130137
webhook-server configuration of work.
131138
properties:
139+
address:
140+
description: |-
141+
Address represents the address of a webhook-server.
142+
It could be in IP format or fqdn format.
143+
The Address must be reachable by apiserver of the hub cluster.
144+
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])$
145+
type: string
132146
healthProbeBindAddress:
133147
default: :8000
134148
description: |-
@@ -148,9 +162,9 @@ spec:
148162
Metrics may be disabled by setting a value of "0" or "".
149163
type: string
150164
port:
151-
default: 9443
152165
description: Port represents the port of a webhook-server.
153-
The default value of Port is 9443.
166+
The default value of Port is 9443 in default mode, or
167+
443 in hosted mode.
154168
format: int32
155169
maximum: 65535
156170
type: integer
@@ -171,16 +185,35 @@ spec:
171185
The Address must be reachable by apiserver of the hub cluster.
172186
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])$
173187
type: string
188+
healthProbeBindAddress:
189+
default: :8000
190+
description: |-
191+
HealthProbeBindAddress represents the healthcheck address of a webhook-server. The default value is ":8000".
192+
Healthchecks may be disabled by setting a value of "0" or "".
193+
type: string
194+
hostNetwork:
195+
description: |-
196+
HostNetwork enables running webhook pods with hostNetwork: true
197+
This may be required in some installations, such as EKS with Calico CNI,
198+
to allow the API Server to communicate with the webhook pods.
199+
type: boolean
200+
metricsBindAddress:
201+
default: :8080
202+
description: |-
203+
MetricsBindAddress represents the metrics address of a webhook-server. The default value is ":8080"
204+
Metrics may be disabled by setting a value of "0" or "".
205+
type: string
174206
port:
175-
default: 443
176207
description: Port represents the port of a webhook-server.
177-
The default value of Port is 443.
208+
The default value of Port is 9443 in default mode, or
209+
443 in hosted mode.
178210
format: int32
179211
maximum: 65535
180212
type: integer
181-
required:
182-
- address
183213
type: object
214+
x-kubernetes-validations:
215+
- message: Address is required for hosted webhook configuration
216+
rule: self.address != ''
184217
workWebhookConfiguration:
185218
description: WorkWebhookConfiguration represents the customized
186219
webhook-server configuration of work.
@@ -192,16 +225,35 @@ spec:
192225
The Address must be reachable by apiserver of the hub cluster.
193226
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])$
194227
type: string
228+
healthProbeBindAddress:
229+
default: :8000
230+
description: |-
231+
HealthProbeBindAddress represents the healthcheck address of a webhook-server. The default value is ":8000".
232+
Healthchecks may be disabled by setting a value of "0" or "".
233+
type: string
234+
hostNetwork:
235+
description: |-
236+
HostNetwork enables running webhook pods with hostNetwork: true
237+
This may be required in some installations, such as EKS with Calico CNI,
238+
to allow the API Server to communicate with the webhook pods.
239+
type: boolean
240+
metricsBindAddress:
241+
default: :8080
242+
description: |-
243+
MetricsBindAddress represents the metrics address of a webhook-server. The default value is ":8080"
244+
Metrics may be disabled by setting a value of "0" or "".
245+
type: string
195246
port:
196-
default: 443
197247
description: Port represents the port of a webhook-server.
198-
The default value of Port is 443.
248+
The default value of Port is 9443 in default mode, or
249+
443 in hosted mode.
199250
format: int32
200251
maximum: 65535
201252
type: integer
202-
required:
203-
- address
204253
type: object
254+
x-kubernetes-validations:
255+
- message: Address is required for hosted webhook configuration
256+
rule: self.address != ''
205257
type: object
206258
mode:
207259
default: Default

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module open-cluster-management.io/ocm
33
go 1.23.6
44

55
// TEMPORARY while waiting for upstream tag – must be removed before merge
6-
replace open-cluster-management.io/api => github.com/bhperry/ocm-api v0.0.0-20250612225613-ffa7865df0a9
6+
replace open-cluster-management.io/api => github.com/bhperry/ocm-api v0.0.0-20250708180941-b2da1b0edc30
77

88
require (
99
github.com/aws/aws-sdk-go-v2 v1.36.3

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ github.com/aws/smithy-go v1.22.2 h1:6D9hW43xKFrRx/tXXfAlIZc4JI+yQe6snnWcQyxSyLQ=
5858
github.com/aws/smithy-go v1.22.2/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
5959
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
6060
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
61-
github.com/bhperry/ocm-api v0.0.0-20250612225613-ffa7865df0a9 h1:Cs8jDa7M7sGmQA3OmGYsnn+yD/aytxyhYym6qtZHsVs=
62-
github.com/bhperry/ocm-api v0.0.0-20250612225613-ffa7865df0a9/go.mod h1:/OeqXycNBZQoe3WG6ghuWsMgsKGuMZrK8ZpsU6gWL0Y=
61+
github.com/bhperry/ocm-api v0.0.0-20250708180941-b2da1b0edc30 h1:E/VOAR32r5XYpf/jcn/9xBREFyzd9nWh3diqwm0lWg8=
62+
github.com/bhperry/ocm-api v0.0.0-20250708180941-b2da1b0edc30/go.mod h1:/OeqXycNBZQoe3WG6ghuWsMgsKGuMZrK8ZpsU6gWL0Y=
6363
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
6464
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
6565
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=

0 commit comments

Comments
 (0)