Skip to content

Commit 5fcf159

Browse files
authored
✨ introduce gRPC configuration (#383)
* introduce gRPC configuration Signed-off-by: clyang82 <[email protected]> * address review comments Signed-off-by: clyang82 <[email protected]> --------- Signed-off-by: clyang82 <[email protected]>
1 parent f781272 commit 5fcf159

File tree

4 files changed

+187
-1
lines changed

4 files changed

+187
-1
lines changed

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

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ spec:
268268
enum:
269269
- csr
270270
- awsirsa
271+
- grpc
271272
type: string
272273
awsirsa:
273274
description: AwsIrsa represents the configuration for awsirsa
@@ -303,6 +304,46 @@ spec:
303304
type: string
304305
type: array
305306
type: object
307+
grpc:
308+
description: GRPC represents the configuration for gRPC
309+
driver.
310+
properties:
311+
autoApprovedIdentities:
312+
description: AutoApprovedIdentities represent a list
313+
of approved arn patterns
314+
items:
315+
type: string
316+
type: array
317+
endpointExposure:
318+
description: EndpointExposure represents the configuration
319+
for endpoint exposure.
320+
properties:
321+
hostname:
322+
description: Hostname points to a fixed hostname
323+
for serving agents' handshakes.
324+
properties:
325+
value:
326+
type: string
327+
required:
328+
- value
329+
type: object
330+
type:
331+
default: hostname
332+
description: |-
333+
Type specifies how the gRPC endpoint is exposed.
334+
You may need to apply an object to expose the gRPC endpoint, for example: a route.
335+
enum:
336+
- hostname
337+
type: string
338+
required:
339+
- type
340+
type: object
341+
imagePullSpec:
342+
default: quay.io/open-cluster-management/registration
343+
description: ImagePullSpec represents the desired image
344+
of the gRPC broker installed on hub.
345+
type: string
346+
type: object
306347
required:
307348
- authType
308349
type: object

operator/v1/types_clustermanager.go

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ type RegistrationDriverHub struct {
122122
// Type of the authentication used by hub to initialize the Hub cluster. Possible values are csr and awsirsa.
123123
// +required
124124
// +kubebuilder:default:=csr
125-
// +kubebuilder:validation:Enum=csr;awsirsa
125+
// +kubebuilder:validation:Enum=csr;awsirsa;grpc
126126
AuthType string `json:"authType,omitempty"`
127127

128128
// CSR represents the configuration for csr driver.
@@ -132,8 +132,56 @@ type RegistrationDriverHub struct {
132132
// AwsIrsa represents the configuration for awsirsa driver.
133133
// +optional
134134
AwsIrsa *AwsIrsaConfig `json:"awsirsa,omitempty"`
135+
136+
// GRPC represents the configuration for gRPC driver.
137+
// +optional
138+
GRPC *GRPCConfig `json:"grpc,omitempty"`
139+
}
140+
141+
// GRPC represents the configuration for gRPC driver.
142+
type GRPCConfig struct {
143+
// ImagePullSpec represents the desired image of the gRPC broker installed on hub.
144+
// +optional
145+
// +kubebuilder:default=quay.io/open-cluster-management/registration
146+
ImagePullSpec string `json:"imagePullSpec,omitempty"`
147+
148+
// EndpointExposure represents the configuration for endpoint exposure.
149+
// +optional
150+
EndpointExposure *GRPCEndpointExposure `json:"endpointExposure,omitempty"`
151+
152+
// AutoApprovedIdentities represent a list of approved arn patterns
153+
// +optional
154+
AutoApprovedIdentities []string `json:"autoApprovedIdentities,omitempty"`
135155
}
136156

157+
type GRPCEndpointExposure struct {
158+
// Type specifies how the gRPC endpoint is exposed.
159+
// You may need to apply an object to expose the gRPC endpoint, for example: a route.
160+
// TODO: support loadbalancer.
161+
// +kubebuilder:default:=hostname
162+
// +kubebuilder:validation:Enum=hostname
163+
// +required
164+
Type GRPCEndpointExposureType `json:"type,omitempty"`
165+
166+
// Hostname points to a fixed hostname for serving agents' handshakes.
167+
// +optional
168+
Hostname *HostnameConfig `json:"hostname,omitempty"`
169+
}
170+
171+
// HostnameConfig references a fixed hostname.
172+
type HostnameConfig struct {
173+
// +required
174+
Value string `json:"value"`
175+
}
176+
177+
// GRPCEndpointExposureType represents the type of endpoint exposure for gRPC.
178+
type GRPCEndpointExposureType string
179+
180+
const (
181+
// GRPCEndpointTypeHostname is the gRPC endpoint exposure type for hostname.
182+
GRPCEndpointTypeHostname GRPCEndpointExposureType = "hostname"
183+
)
184+
137185
type CSRConfig struct {
138186
// AutoApprovedIdentities represent a list of approved users
139187
// +optional

operator/v1/zz_generated.deepcopy.go

Lines changed: 68 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: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)