Skip to content

Commit 9fed584

Browse files
committed
support loadBalancer for grpc endpoint type
Signed-off-by: Zhiwei Yin <[email protected]>
1 parent ded1e02 commit 9fed584

File tree

19 files changed

+1373
-62
lines changed

19 files changed

+1373
-62
lines changed

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

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,13 +580,43 @@ spec:
580580
required:
581581
- host
582582
type: object
583+
loadBalancer:
584+
description: LoadBalancer points customized configuration
585+
for loadBalancer type.
586+
properties:
587+
caBundle:
588+
description: CABundle is a customized caBundle of
589+
the endpoint.
590+
format: byte
591+
type: string
592+
host:
593+
description: Host is the customized host name of
594+
the endpoint.
595+
type: string
596+
type: object
597+
route:
598+
description: Route points customized configuration for
599+
route type.
600+
properties:
601+
caBundle:
602+
description: CABundle is a customized caBundle of
603+
the endpoint.
604+
format: byte
605+
type: string
606+
host:
607+
description: Host is the customized host name of
608+
the endpoint.
609+
type: string
610+
type: object
583611
type:
584612
default: hostname
585613
description: |-
586614
type specifies how the endpoint is exposed.
587615
You may need to apply an object to expose the endpoint, for example: a route.
588616
enum:
589617
- hostname
618+
- loadBalancer
619+
- route
590620
type: string
591621
required:
592622
- type
@@ -609,13 +639,43 @@ spec:
609639
required:
610640
- host
611641
type: object
642+
loadBalancer:
643+
description: LoadBalancer points customized configuration
644+
for loadBalancer type.
645+
properties:
646+
caBundle:
647+
description: CABundle is a customized caBundle of
648+
the endpoint.
649+
format: byte
650+
type: string
651+
host:
652+
description: Host is the customized host name of
653+
the endpoint.
654+
type: string
655+
type: object
656+
route:
657+
description: Route points customized configuration for
658+
route type.
659+
properties:
660+
caBundle:
661+
description: CABundle is a customized caBundle of
662+
the endpoint.
663+
format: byte
664+
type: string
665+
host:
666+
description: Host is the customized host name of
667+
the endpoint.
668+
type: string
669+
type: object
612670
type:
613671
default: hostname
614672
description: |-
615673
type specifies how the endpoint is exposed.
616674
You may need to apply an object to expose the endpoint, for example: a route.
617675
enum:
618676
- hostname
677+
- loadBalancer
678+
- route
619679
type: string
620680
required:
621681
- type

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

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,13 +580,43 @@ spec:
580580
required:
581581
- host
582582
type: object
583+
loadBalancer:
584+
description: LoadBalancer points customized configuration
585+
for loadBalancer type.
586+
properties:
587+
caBundle:
588+
description: CABundle is a customized caBundle of
589+
the endpoint.
590+
format: byte
591+
type: string
592+
host:
593+
description: Host is the customized host name of
594+
the endpoint.
595+
type: string
596+
type: object
597+
route:
598+
description: Route points customized configuration for
599+
route type.
600+
properties:
601+
caBundle:
602+
description: CABundle is a customized caBundle of
603+
the endpoint.
604+
format: byte
605+
type: string
606+
host:
607+
description: Host is the customized host name of
608+
the endpoint.
609+
type: string
610+
type: object
583611
type:
584612
default: hostname
585613
description: |-
586614
type specifies how the endpoint is exposed.
587615
You may need to apply an object to expose the endpoint, for example: a route.
588616
enum:
589617
- hostname
618+
- loadBalancer
619+
- route
590620
type: string
591621
required:
592622
- type
@@ -609,13 +639,43 @@ spec:
609639
required:
610640
- host
611641
type: object
642+
loadBalancer:
643+
description: LoadBalancer points customized configuration
644+
for loadBalancer type.
645+
properties:
646+
caBundle:
647+
description: CABundle is a customized caBundle of
648+
the endpoint.
649+
format: byte
650+
type: string
651+
host:
652+
description: Host is the customized host name of
653+
the endpoint.
654+
type: string
655+
type: object
656+
route:
657+
description: Route points customized configuration for
658+
route type.
659+
properties:
660+
caBundle:
661+
description: CABundle is a customized caBundle of
662+
the endpoint.
663+
format: byte
664+
type: string
665+
host:
666+
description: Host is the customized host name of
667+
the endpoint.
668+
type: string
669+
type: object
612670
type:
613671
default: hostname
614672
description: |-
615673
type specifies how the endpoint is exposed.
616674
You may need to apply an object to expose the endpoint, for example: a route.
617675
enum:
618676
- hostname
677+
- loadBalancer
678+
- route
619679
type: string
620680
required:
621681
- type

deploy/cluster-manager/olm-catalog/latest/manifests/cluster-manager.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ metadata:
5959
categories: Integration & Delivery,OpenShift Optional
6060
certified: "false"
6161
containerImage: quay.io/open-cluster-management/registration-operator:latest
62-
createdAt: "2025-10-21T02:16:40Z"
62+
createdAt: "2025-11-12T07:34:59Z"
6363
description: Manages the installation and upgrade of the ClusterManager.
6464
operators.operatorframework.io/builder: operator-sdk-v1.32.0
6565
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3

deploy/cluster-manager/olm-catalog/latest/manifests/operator.open-cluster-management.io_clustermanagers.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,13 +580,43 @@ spec:
580580
required:
581581
- host
582582
type: object
583+
loadBalancer:
584+
description: LoadBalancer points customized configuration
585+
for loadBalancer type.
586+
properties:
587+
caBundle:
588+
description: CABundle is a customized caBundle of
589+
the endpoint.
590+
format: byte
591+
type: string
592+
host:
593+
description: Host is the customized host name of
594+
the endpoint.
595+
type: string
596+
type: object
597+
route:
598+
description: Route points customized configuration for
599+
route type.
600+
properties:
601+
caBundle:
602+
description: CABundle is a customized caBundle of
603+
the endpoint.
604+
format: byte
605+
type: string
606+
host:
607+
description: Host is the customized host name of
608+
the endpoint.
609+
type: string
610+
type: object
583611
type:
584612
default: hostname
585613
description: |-
586614
type specifies how the endpoint is exposed.
587615
You may need to apply an object to expose the endpoint, for example: a route.
588616
enum:
589617
- hostname
618+
- loadBalancer
619+
- route
590620
type: string
591621
required:
592622
- type
@@ -609,13 +639,43 @@ spec:
609639
required:
610640
- host
611641
type: object
642+
loadBalancer:
643+
description: LoadBalancer points customized configuration
644+
for loadBalancer type.
645+
properties:
646+
caBundle:
647+
description: CABundle is a customized caBundle of
648+
the endpoint.
649+
format: byte
650+
type: string
651+
host:
652+
description: Host is the customized host name of
653+
the endpoint.
654+
type: string
655+
type: object
656+
route:
657+
description: Route points customized configuration for
658+
route type.
659+
properties:
660+
caBundle:
661+
description: CABundle is a customized caBundle of
662+
the endpoint.
663+
format: byte
664+
type: string
665+
host:
666+
description: Host is the customized host name of
667+
the endpoint.
668+
type: string
669+
type: object
612670
type:
613671
default: hostname
614672
description: |-
615673
type specifies how the endpoint is exposed.
616674
You may need to apply an object to expose the endpoint, for example: a route.
617675
enum:
618676
- hostname
677+
- loadBalancer
678+
- route
619679
type: string
620680
required:
621681
- type

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ require (
4040
k8s.io/kubectl v0.33.4
4141
k8s.io/utils v0.0.0-20241210054802-24370beab758
4242
open-cluster-management.io/addon-framework v1.1.0
43-
open-cluster-management.io/api v1.1.0
43+
open-cluster-management.io/api v1.1.1-0.20251112045944-3e1bb92b69e3
4444
open-cluster-management.io/sdk-go v1.1.0
4545
sigs.k8s.io/about-api v0.0.0-20250131010323-518069c31c03
4646
sigs.k8s.io/cluster-inventory-api v0.0.0-20240730014211-ef0154379848

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,8 @@ k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJ
567567
k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
568568
open-cluster-management.io/addon-framework v1.1.0 h1:GoPbg5Q9KEI+Vvgs9PUs2IjIoU/BoXPHEyULVNLF/po=
569569
open-cluster-management.io/addon-framework v1.1.0/go.mod h1:KPdLM+CfUKgwVuVE9Tyu2nOuD6LgDmx94HOCnJwLIdo=
570-
open-cluster-management.io/api v1.1.0 h1:fu5xst9T/Ya6o41kqdd0zbNiDU+D3nNMTvoRVeF8j+U=
571-
open-cluster-management.io/api v1.1.0/go.mod h1:lEc5Wkc9ON5ym/qAtIqNgrE7NW7IEOCOC611iQMlnKM=
570+
open-cluster-management.io/api v1.1.1-0.20251112045944-3e1bb92b69e3 h1:pJl/jwiUBO0D4PrL+G6JASKC8PDpPoxItLa6cTcj8TM=
571+
open-cluster-management.io/api v1.1.1-0.20251112045944-3e1bb92b69e3/go.mod h1:lEc5Wkc9ON5ym/qAtIqNgrE7NW7IEOCOC611iQMlnKM=
572572
open-cluster-management.io/sdk-go v1.1.0 h1:vYGkoihIVetyVT4ICO7HjoUHsnh6Gf+Da4ZSmWCamhc=
573573
open-cluster-management.io/sdk-go v1.1.0/go.mod h1:DH4EMNDMiousmaj+noHYQxm48T+dbogiAfALhDnrjMg=
574574
sigs.k8s.io/about-api v0.0.0-20250131010323-518069c31c03 h1:1ShFiMjGQOR/8jTBkmZrk1gORxnvMwm1nOy2/DbHg4U=

manifests/cluster-manager/hub/grpc-server/clusterrole.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ rules:
1515
- apiGroups: [""]
1616
resources: ["pods"]
1717
verbs: ["get"]
18+
- apiGroups: ["apps"]
19+
resources: ["replicasets"]
20+
verbs: ["get"]
1821
- apiGroups: ["", "events.k8s.io"]
1922
resources: ["events"]
2023
verbs: ["get", "create", "patch", "update"]

manifests/cluster-manager/hub/grpc-server/service.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ spec:
1414
app: {{ .ClusterManagerName }}-grpc-server
1515
ports:
1616
- protocol: TCP
17-
port: 8090
17+
{{ if eq .GRPCEndpointType "loadBalancer" }}
18+
port: 443
19+
{{ else }}
20+
port: 8090
21+
{{ end }}
1822
targetPort: 8090
23+
{{ if eq .GRPCEndpointType "loadBalancer" }}
24+
type: LoadBalancer
25+
{{ else }}
1926
type: ClusterIP
27+
{{ end }}

manifests/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ type HubConfig struct {
4343
GRPCAuthEnabled bool
4444
GRPCServerImage string
4545
GRPCAutoApprovedUsers string
46+
GRPCEndpointType string
4647
}
4748

4849
type Webhook struct {

0 commit comments

Comments
 (0)