Skip to content

✨ Support default mode webhook networking configuration #1035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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,71 @@ spec:
DeployOption contains the options of deploying a cluster-manager
Default mode is used if DeployOption is not set.
properties:
default:
description: Default includes configurations for clustermanager
in the Default mode
properties:
registrationWebhookConfiguration:
description: RegistrationWebhookConfiguration represents the
customized webhook-server configuration of registration.
properties:
healthProbeBindAddress:
default: :8000
description: |-
HealthProbeBindAddress represents the healthcheck address of a webhook-server. The default value is ":8000".
Healthchecks may be disabled by setting a value of "0" or "".
type: string
hostNetwork:
description: |-
HostNetwork enables running webhook pods with hostNetwork: true
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
metricsBindAddress:
default: :8080
description: |-
MetricsBindAddress represents the metrics address of a webhook-server. The default value is ":8080"
Metrics may be disabled by setting a value of "0" or "".
type: string
port:
default: 9443
description: Port represents the port of a webhook-server.
The default value of Port is 9443.
format: int32
maximum: 65535
type: integer
type: object
workWebhookConfiguration:
description: WorkWebhookConfiguration represents the customized
webhook-server configuration of work.
properties:
healthProbeBindAddress:
default: :8000
description: |-
HealthProbeBindAddress represents the healthcheck address of a webhook-server. The default value is ":8000".
Healthchecks may be disabled by setting a value of "0" or "".
type: string
hostNetwork:
description: |-
HostNetwork enables running webhook pods with hostNetwork: true
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
metricsBindAddress:
default: :8080
description: |-
MetricsBindAddress represents the metrics address of a webhook-server. The default value is ":8080"
Metrics may be disabled by setting a value of "0" or "".
type: string
port:
default: 9443
description: Port represents the port of a webhook-server.
The default value of Port is 9443.
format: int32
maximum: 65535
type: integer
type: object
type: object
hosted:
description: Hosted includes configurations we need for clustermanager
in the Hosted mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,71 @@ spec:
DeployOption contains the options of deploying a cluster-manager
Default mode is used if DeployOption is not set.
properties:
default:
description: Default includes configurations for clustermanager
in the Default mode
properties:
registrationWebhookConfiguration:
description: RegistrationWebhookConfiguration represents the
customized webhook-server configuration of registration.
properties:
healthProbeBindAddress:
default: :8000
description: |-
HealthProbeBindAddress represents the healthcheck address of a webhook-server. The default value is ":8000".
Healthchecks may be disabled by setting a value of "0" or "".
type: string
hostNetwork:
description: |-
HostNetwork enables running webhook pods with hostNetwork: true
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
metricsBindAddress:
default: :8080
description: |-
MetricsBindAddress represents the metrics address of a webhook-server. The default value is ":8080"
Metrics may be disabled by setting a value of "0" or "".
type: string
port:
default: 9443
description: Port represents the port of a webhook-server.
The default value of Port is 9443.
format: int32
maximum: 65535
type: integer
type: object
workWebhookConfiguration:
description: WorkWebhookConfiguration represents the customized
webhook-server configuration of work.
properties:
healthProbeBindAddress:
default: :8000
description: |-
HealthProbeBindAddress represents the healthcheck address of a webhook-server. The default value is ":8000".
Healthchecks may be disabled by setting a value of "0" or "".
type: string
hostNetwork:
description: |-
HostNetwork enables running webhook pods with hostNetwork: true
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
metricsBindAddress:
default: :8080
description: |-
MetricsBindAddress represents the metrics address of a webhook-server. The default value is ":8080"
Metrics may be disabled by setting a value of "0" or "".
type: string
port:
default: 9443
description: Port represents the port of a webhook-server.
The default value of Port is 9443.
format: int32
maximum: 65535
type: integer
type: object
type: object
hosted:
description: Hosted includes configurations we need for clustermanager
in the Hosted mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ metadata:
categories: Integration & Delivery,OpenShift Optional
certified: "false"
containerImage: quay.io/open-cluster-management/registration-operator:latest
createdAt: "2025-05-29T02:56:45Z"
createdAt: "2025-06-12T23:20:27Z"
description: Manages the installation and upgrade of the ClusterManager.
operators.operatorframework.io/builder: operator-sdk-v1.32.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,71 @@ spec:
DeployOption contains the options of deploying a cluster-manager
Default mode is used if DeployOption is not set.
properties:
default:
description: Default includes configurations for clustermanager
in the Default mode
properties:
registrationWebhookConfiguration:
description: RegistrationWebhookConfiguration represents the
customized webhook-server configuration of registration.
properties:
healthProbeBindAddress:
default: :8000
description: |-
HealthProbeBindAddress represents the healthcheck address of a webhook-server. The default value is ":8000".
Healthchecks may be disabled by setting a value of "0" or "".
type: string
hostNetwork:
description: |-
HostNetwork enables running webhook pods with hostNetwork: true
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
metricsBindAddress:
default: :8080
description: |-
MetricsBindAddress represents the metrics address of a webhook-server. The default value is ":8080"
Metrics may be disabled by setting a value of "0" or "".
type: string
port:
default: 9443
description: Port represents the port of a webhook-server.
The default value of Port is 9443.
format: int32
maximum: 65535
type: integer
type: object
workWebhookConfiguration:
description: WorkWebhookConfiguration represents the customized
webhook-server configuration of work.
properties:
healthProbeBindAddress:
default: :8000
description: |-
HealthProbeBindAddress represents the healthcheck address of a webhook-server. The default value is ":8000".
Healthchecks may be disabled by setting a value of "0" or "".
type: string
hostNetwork:
description: |-
HostNetwork enables running webhook pods with hostNetwork: true
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
metricsBindAddress:
default: :8080
description: |-
MetricsBindAddress represents the metrics address of a webhook-server. The default value is ":8080"
Metrics may be disabled by setting a value of "0" or "".
type: string
port:
default: 9443
description: Port represents the port of a webhook-server.
The default value of Port is 9443.
format: int32
maximum: 65535
type: integer
type: object
type: object
hosted:
description: Hosted includes configurations we need for clustermanager
in the Hosted mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ metadata:
categories: Integration & Delivery,OpenShift Optional
certified: "false"
containerImage: quay.io/open-cluster-management/registration-operator:latest
createdAt: "2025-05-29T02:56:45Z"
createdAt: "2025-06-12T23:20:27Z"
description: Manages the installation and upgrade of the Klusterlet.
operators.operatorframework.io/builder: operator-sdk-v1.32.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ module open-cluster-management.io/ocm

go 1.23.6

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

require (
github.com/aws/aws-sdk-go-v2 v1.36.3
github.com/aws/aws-sdk-go-v2/config v1.29.14
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ github.com/aws/smithy-go v1.22.2 h1:6D9hW43xKFrRx/tXXfAlIZc4JI+yQe6snnWcQyxSyLQ=
github.com/aws/smithy-go v1.22.2/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bhperry/ocm-api v0.0.0-20250612225613-ffa7865df0a9 h1:Cs8jDa7M7sGmQA3OmGYsnn+yD/aytxyhYym6qtZHsVs=
github.com/bhperry/ocm-api v0.0.0-20250612225613-ffa7865df0a9/go.mod h1:/OeqXycNBZQoe3WG6ghuWsMgsKGuMZrK8ZpsU6gWL0Y=
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
Expand Down Expand Up @@ -491,8 +493,6 @@ k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6J
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
open-cluster-management.io/addon-framework v1.0.0 h1:ejTk4hPAJnwCSxQhY/tVDPg3SeH91lVfWqSaJcYiKwg=
open-cluster-management.io/addon-framework v1.0.0/go.mod h1:Gw9zRGvuNJJ3XhTYanIuA7FFFw0EjtoE74l5OBZCZf8=
open-cluster-management.io/api v1.0.0 h1:54QllH9DTudCk6VrGt0q8CDsE3MghqJeTaTN4RHZpE0=
open-cluster-management.io/api v1.0.0/go.mod h1:/OeqXycNBZQoe3WG6ghuWsMgsKGuMZrK8ZpsU6gWL0Y=
open-cluster-management.io/sdk-go v1.0.0 h1:pIiAHM/hzV3rEw3LSMgZuAUiNgkBrn8hLxFvJM5frw0=
open-cluster-management.io/sdk-go v1.0.0/go.mod h1:vkLwIDN9W+WBlrHgHxMl5ZoHRT+H5qOq3cXAk7U5AJc=
sigs.k8s.io/about-api v0.0.0-20250131010323-518069c31c03 h1:1ShFiMjGQOR/8jTBkmZrk1gORxnvMwm1nOy2/DbHg4U=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ spec:
app: {{ .ClusterManagerName }}-registration-webhook
ports:
- name: webhook
port: 9443
targetPort: 9443
port: {{ .RegistrationWebhook.Port }}
targetPort: {{ .RegistrationWebhook.Port }}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ spec:
app: {{ .ClusterManagerName }}-work-webhook
ports:
- name: webhook
port: 9443
targetPort: 9443
port: {{ .WorkWebhook.Port }}
targetPort: {{ .WorkWebhook.Port }}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ webhooks:
namespace: {{ .ClusterManagerNamespace }}
name: cluster-manager-work-webhook
path: /validate-work-open-cluster-management-io-v1-manifestwork
port: {{.RegistrationWebhook.Port}}
caBundle: {{ .RegistrationAPIServiceCABundle }}
port: {{.WorkWebhook.Port}}
caBundle: {{ .WorkAPIServiceCABundle }}
rules:
- operations:
- CREATE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ metadata:
{{ end }}
spec:
replicas: {{ .Replica }}
{{- if .RegistrationWebhook.HostNetwork }}
strategy:
rollingUpdate:
{{- if lt .Replica 4 }}
maxUnavailable: 1
{{- else }}
maxUnavailable: 25%
{{- end }}
type: RollingUpdate
{{- end }}
selector:
matchLabels:
app: {{ .ClusterManagerName }}-registration-webhook
Expand Down Expand Up @@ -65,7 +75,9 @@ spec:
args:
- /registration
- "webhook-server"
- "port=9443"
- "--port={{ .RegistrationWebhook.Port }}"
- "--health-probe-bind-address={{ .RegistrationWebhook.HealthProbeBindAddress }}"
- "--metrics-bind-address={{ .RegistrationWebhook.MetricsBindAddress }}"
{{ if gt (len .RegistrationFeatureGates) 0 }}
{{range .RegistrationFeatureGates}}
- {{ . }}
Expand Down Expand Up @@ -97,21 +109,23 @@ spec:
privileged: false
runAsNonRoot: true
readOnlyRootFilesystem: true
{{- if gt .RegistrationWebhook.HealthProbePort 0 }}
livenessProbe:
httpGet:
path: /healthz
scheme: HTTP
port: 8000
port: {{ .RegistrationWebhook.HealthProbePort }}
initialDelaySeconds: 2
periodSeconds: 10
readinessProbe:
httpGet:
path: /readyz
scheme: HTTP
port: 8000
port: {{ .RegistrationWebhook.HealthProbePort }}
initialDelaySeconds: 2
{{- end }}
ports:
- containerPort: 9443
- containerPort: {{ .RegistrationWebhook.Port }}
protocol: TCP
volumeMounts:
- mountPath: /tmp/k8s-webhook-server/serving-certs
Expand All @@ -122,6 +136,10 @@ spec:
name: kubeconfig
readOnly: true
{{ end }}
{{- if .RegistrationWebhook.HostNetwork }}
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: true
{{- end }}
volumes:
- name: webhook-secret
secret:
Expand Down
Loading
Loading