Skip to content

Commit

Permalink
Add fields in Service
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>
  • Loading branch information
yeahdongcn committed Dec 18, 2023
1 parent febbdd3 commit ead451c
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
10 changes: 10 additions & 0 deletions api/v1/service.go
@@ -1,5 +1,7 @@
package v1

import corev1 "k8s.io/api/core/v1"

/* Copied from https://github.com/loft-sh/vcluster/blob/main/charts/k3s/values.yaml#L273
# Service configurations
Expand All @@ -25,4 +27,12 @@ service:
*/

type Service struct {
//+kubebuilder:validation:Enum=ClusterIP;NodePort;LoadBalancer;ExternalName
Type corev1.ServiceType `json:"type,omitempty"`
ExternalIPs []string `json:"externalIPs,omitempty"`
//+kubebuilder:validation:Enum=Local;Cluster
ExternalTrafficPolicy corev1.ServiceExternalTrafficPolicy `json:"externalTrafficPolicy,omitempty"`
LoadBalancerIP string `json:"loadBalancerIP,omitempty"`
LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty"`
LoadBalancerClass *string `json:"loadBalancerClass,omitempty"`
}
17 changes: 16 additions & 1 deletion api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions config/crd/bases/storage.openloft.cn_virtualclusters.yaml
Expand Up @@ -1051,6 +1051,37 @@ spec:
type: object
type: object
service:
properties:
externalIPs:
items:
type: string
type: array
externalTrafficPolicy:
description: ServiceExternalTrafficPolicy describes how nodes
distribute service traffic they receive on one of the Service's
"externally-facing" addresses (NodePorts, ExternalIPs, and LoadBalancer
IPs.
enum:
- Local
- Cluster
type: string
loadBalancerClass:
type: string
loadBalancerIP:
type: string
loadBalancerSourceRanges:
items:
type: string
type: array
type:
description: Service Type string describes ingress methods for
a service
enum:
- ClusterIP
- NodePort
- LoadBalancer
- ExternalName
type: string
type: object
sync:
description: Sync defines the configuration for sync
Expand Down

0 comments on commit ead451c

Please sign in to comment.