Skip to content

Commit 280cf8e

Browse files
authored
add apiservice target ports (#135)
Signed-off-by: xuezhaojun <[email protected]>
1 parent 918b7bf commit 280cf8e

File tree

4 files changed

+125
-0
lines changed

4 files changed

+125
-0
lines changed

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,42 @@ spec:
4545
enum:
4646
- Default
4747
- Detached
48+
detached:
49+
description: Detached includes configurations we needs for clustermanager in the detached mode.
50+
type: object
51+
properties:
52+
registrationWebhookConfiguration:
53+
description: RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration.
54+
type: object
55+
required:
56+
- address
57+
properties:
58+
address:
59+
description: Address represents the address of a webhook-server. It could be in IP format or fqdn format. The Address must be reachable by apiserver of the hub cluster.
60+
type: string
61+
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])$
62+
port:
63+
description: Port represents the port of a webhook-server. The default value of Port is 443.
64+
type: integer
65+
format: int32
66+
default: 443
67+
maximum: 65535
68+
workWebhookConfiguration:
69+
description: WorkWebhookConfiguration represents the customized webhook-server configuration of work.
70+
type: object
71+
required:
72+
- address
73+
properties:
74+
address:
75+
description: Address represents the address of a webhook-server. It could be in IP format or fqdn format. The Address must be reachable by apiserver of the hub cluster.
76+
type: string
77+
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])$
78+
port:
79+
description: Port represents the port of a webhook-server. The default value of Port is 443.
80+
type: integer
81+
format: int32
82+
default: 443
83+
maximum: 65535
4884
nodePlacement:
4985
description: NodePlacement enables explicit control over the scheduling of the deployed pods.
5086
type: object

operator/v1/types.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,39 @@ type ClusterManagerSpec struct {
5252
// +optional
5353
// +kubebuilder:default={mode: Default}
5454
DeployOption DeployOption `json:"deployOption,omitempty"`
55+
56+
// Detached includes configurations we needs for clustermanager in the detached mode.
57+
// +optional
58+
Detached DetachedClusterManagerConfiguration `json:"detached,omitempty"`
59+
}
60+
61+
// DetachedClusterManagerConfiguration represents customized configurations we need to set for clustermanager in the detached mode.
62+
type DetachedClusterManagerConfiguration struct {
63+
// RegistrationWebhookConfiguration represents the customized webhook-server configuration of registration.
64+
// +optional
65+
RegistrationWebhookConfiguration WebhookConfiguration `json:"registrationWebhookConfiguration,omitempty"`
66+
67+
// WorkWebhookConfiguration represents the customized webhook-server configuration of work.
68+
// +optional
69+
WorkWebhookConfiguration WebhookConfiguration `json:"workWebhookConfiguration,omitempty"`
70+
}
71+
72+
// WebhookConfiguration has two properties: Address and Port.
73+
type WebhookConfiguration struct {
74+
// Address represents the address of a webhook-server.
75+
// It could be in IP format or fqdn format.
76+
// The Address must be reachable by apiserver of the hub cluster.
77+
// +required
78+
// +kubebuilder:validation:Required
79+
// +kubebuilder:validation: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])$
80+
Address string `json:"address"`
81+
82+
// Port represents the port of a webhook-server. The default value of Port is 443.
83+
// +optional
84+
// +default=443
85+
// +kubebuilder:default=443
86+
// +kubebuilder:validation:Maximum=65535
87+
Port int32 `json:"port,omitempty"`
5588
}
5689

5790
// DeployOption describes the deploy options for cluster-manager or klusterlet

operator/v1/zz_generated.deepcopy.go

Lines changed: 35 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: 21 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)