Skip to content

Commit b270d02

Browse files
authored
Merge pull request #5769 from RainbowMango/pr_restrict_operator_service_type
Restrict supported service types of Karamda APIServer supported by karmada-operator
2 parents 057cf86 + a644477 commit b270d02

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

charts/karmada-operator/crds/operator.karmada.io_karmadas.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -2539,9 +2539,15 @@ spec:
25392539
Defaults to "10.96.0.0/12".
25402540
type: string
25412541
serviceType:
2542-
description: |-
2543-
ServiceType represents the service type of karmada apiserver.
2544-
it is ClusterIP by default.
2542+
default: ClusterIP
2543+
description: |-
2544+
ServiceType represents the service type of Karmada API server.
2545+
Valid options are: "ClusterIP", "NodePort", "LoadBalancer".
2546+
Defaults to "ClusterIP".
2547+
enum:
2548+
- ClusterIP
2549+
- NodePort
2550+
- LoadBalancer
25452551
type: string
25462552
type: object
25472553
karmadaAggregatedAPIServer:

operator/config/crds/operator.karmada.io_karmadas.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -2539,9 +2539,15 @@ spec:
25392539
Defaults to "10.96.0.0/12".
25402540
type: string
25412541
serviceType:
2542-
description: |-
2543-
ServiceType represents the service type of karmada apiserver.
2544-
it is ClusterIP by default.
2542+
default: ClusterIP
2543+
description: |-
2544+
ServiceType represents the service type of Karmada API server.
2545+
Valid options are: "ClusterIP", "NodePort", "LoadBalancer".
2546+
Defaults to "ClusterIP".
2547+
enum:
2548+
- ClusterIP
2549+
- NodePort
2550+
- LoadBalancer
25452551
type: string
25462552
type: object
25472553
karmadaAggregatedAPIServer:

operator/pkg/apis/operator/v1alpha1/type.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,12 @@ type KarmadaAPIServer struct {
277277
// +optional
278278
ServiceSubnet *string `json:"serviceSubnet,omitempty"`
279279

280-
// ServiceType represents the service type of karmada apiserver.
281-
// it is ClusterIP by default.
280+
// ServiceType represents the service type of Karmada API server.
281+
// Valid options are: "ClusterIP", "NodePort", "LoadBalancer".
282+
// Defaults to "ClusterIP".
283+
//
284+
// +kubebuilder:default="ClusterIP"
285+
// +kubebuilder:validation:Enum=ClusterIP;NodePort;LoadBalancer
282286
// +optional
283287
ServiceType corev1.ServiceType `json:"serviceType,omitempty"`
284288

0 commit comments

Comments
 (0)