Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(AM-11526,AM-11741): Slice Gateway External LoadBalancer #180

Merged
merged 13 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions apis/controller/v1alpha1/sliceconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ type WorkerSliceGatewayProvider struct {
//+kubebuilder:default:=Local
// +kubebuilder:validation:Required
SliceCaType string `json:"sliceCaType"`

SliceGatewayServiceType []SliceGatewayServiceType `json:"sliceGatewayServiceType,omitempty"`
}

type SliceGatewayServiceType struct {
// +kubebuilder:validation:Required
Cluster string `json:"cluster"`
// +kubebuilder:validation:Required
//+kubebuilder:default:=NodePort
//+kubebuilder:validation:Enum:=NodePort;LoadBalancer
Type string `json:"type"`
// +kubebuilder:validation:Required
//+kubebuilder:default:=UDP
//+kubebuilder:validation:Enum:=TCP;UDP
Protocol string `json:"protocol"`
}

// QOSProfile is the QOS Profile configuration from backend
Expand Down
22 changes: 21 additions & 1 deletion apis/controller/v1alpha1/zz_generated.deepcopy.go

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

6 changes: 6 additions & 0 deletions apis/worker/v1alpha1/workersliceconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ type WorkerSliceGatewayProvider struct {
SliceGatewayType string `json:"sliceGatewayType,omitempty"`
//+kubebuilder:default:=Local
SliceCaType string `json:"sliceCaType,omitempty"`
//+kubebuilder:default:=NodePort
//+kubebuilder:validation:Enum:=NodePort;LoadBalancer
SliceGatewayServiceType string `json:"sliceGatewayServiceType,omitempty"`
//+kubebuilder:default:=UDP
//+kubebuilder:validation:Enum:=TCP;UDP
SliceGatewayProtocol string `json:"sliceGatewayProtocol,omitempty"`
}

// QOSProfile is the QOS Profile configuration from backend
Expand Down
25 changes: 16 additions & 9 deletions apis/worker/v1alpha1/workerslicegateway_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ type WorkerSliceGatewaySpec struct {
//+kubebuilder:default:=OpenVPN
GatewayType string `json:"gatewayType,omitempty"`
//+kubebuilder:validation:Enum:=Client;Server
GatewayHostType string `json:"gatewayHostType,omitempty"`
GatewayHostType string `json:"gatewayHostType,omitempty"`
//+kubebuilder:default:=NodePort
//+kubebuilder:validation:Enum:=NodePort;LoadBalancer
GatewayConnectivityType string `json:"gatewayConnectivityType,omitempty"`
//+kubebuilder:default:=UDP
//+kubebuilder:validation:Enum:=TCP;UDP
GatewayProtocol string `json:"gatewayProtocol,omitempty"`
GatewayCredentials GatewayCredentials `json:"gatewayCredentials,omitempty"`
LocalGatewayConfig SliceGatewayConfig `json:"localGatewayConfig,omitempty"`
RemoteGatewayConfig SliceGatewayConfig `json:"remoteGatewayConfig,omitempty"`
Expand All @@ -38,14 +44,15 @@ type WorkerSliceGatewaySpec struct {

type SliceGatewayConfig struct {
//+kubebuilder:deprecatedversion:warning="worker/v1alpha1 NodeIp is deprecated...use NodeIps"
NodeIp string `json:"nodeIp,omitempty"`
NodeIps []string `json:"nodeIps,omitempty"`
NodePort int `json:"nodePort,omitempty"`
NodePorts []int `json:"nodePorts,omitempty"`
GatewayName string `json:"gatewayName,omitempty"`
ClusterName string `json:"clusterName,omitempty"`
VpnIp string `json:"vpnIp,omitempty"`
GatewaySubnet string `json:"gatewaySubnet,omitempty"`
NodeIp string `json:"nodeIp,omitempty"`
NodeIps []string `json:"nodeIps,omitempty"`
LoadBalancerIps []string `json:"loadBalancerIps,omitempty"`
NodePort int `json:"nodePort,omitempty"`
NodePorts []int `json:"nodePorts,omitempty"`
GatewayName string `json:"gatewayName,omitempty"`
ClusterName string `json:"clusterName,omitempty"`
VpnIp string `json:"vpnIp,omitempty"`
GatewaySubnet string `json:"gatewaySubnet,omitempty"`
}

type GatewayCredentials struct {
Expand Down
5 changes: 5 additions & 0 deletions apis/worker/v1alpha1/zz_generated.deepcopy.go

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

23 changes: 23 additions & 0 deletions config/crd/bases/controller.kubeslice.io_sliceconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,29 @@ spec:
sliceCaType:
default: Local
type: string
sliceGatewayServiceType:
items:
properties:
cluster:
type: string
protocol:
default: UDP
enum:
- TCP
- UDP
type: string
type:
default: NodePort
enum:
- NodePort
- LoadBalancer
type: string
required:
- cluster
- protocol
- type
type: object
type: array
sliceGatewayType:
default: OpenVPN
type: string
Expand Down
12 changes: 12 additions & 0 deletions config/crd/bases/worker.kubeslice.io_workersliceconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ spec:
sliceCaType:
default: Local
type: string
sliceGatewayProtocol:
default: UDP
enum:
- TCP
- UDP
type: string
sliceGatewayServiceType:
default: NodePort
enum:
- NodePort
- LoadBalancer
type: string
sliceGatewayType:
default: OpenVPN
type: string
Expand Down
20 changes: 20 additions & 0 deletions config/crd/bases/worker.kubeslice.io_workerslicegateways.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ spec:
spec:
description: WorkerSliceGatewaySpec defines the desired state of WorkerSliceGateway
properties:
gatewayConnectivityType:
default: NodePort
enum:
- NodePort
- LoadBalancer
type: string
gatewayCredentials:
properties:
secretName:
Expand All @@ -47,6 +53,12 @@ spec:
type: string
gatewayNumber:
type: integer
gatewayProtocol:
default: UDP
enum:
- TCP
- UDP
type: string
gatewayType:
default: OpenVPN
type: string
Expand All @@ -58,6 +70,10 @@ spec:
type: string
gatewaySubnet:
type: string
loadBalancerIps:
items:
type: string
type: array
nodeIp:
type: string
nodeIps:
Expand All @@ -81,6 +97,10 @@ spec:
type: string
gatewaySubnet:
type: string
loadBalancerIps:
items:
type: string
type: array
nodeIp:
type: string
nodeIps:
Expand Down
8 changes: 5 additions & 3 deletions service/kube_slice_resource_names.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,11 @@ var (
)

const (
serverGateway = "Server"
clientGateway = "Client"
workerSliceGatewayType = "OpenVPN"
serverGateway = "Server"
clientGateway = "Client"
workerSliceGatewayType = "OpenVPN"
defaultSliceGatewayServiceType = "NodePort"
defaultSliceGatewayServiceProtocol = "UDP"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion service/mocks/IVpnKeyRotationService.go

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

20 changes: 11 additions & 9 deletions service/mocks/IWorkerSliceConfigService.go

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

Loading
Loading