Skip to content

Commit

Permalink
Merge pull request #29 from kubeslice/feature-slicegw-lb
Browse files Browse the repository at this point in the history
feat(AM-11646): slicegw external lb changes
  • Loading branch information
Mridul Gain authored Oct 4, 2023
2 parents 3e194ed + 1ab0bfc commit 8be3403
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
15 changes: 13 additions & 2 deletions pkg/controller/v1alpha1/sliceconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ type SliceConfigSpec struct {
QosProfileDetails *QOSProfile `json:"qosProfileDetails,omitempty"` // FIXME: Add OneOf StandardQosProfileName vs QosProfileDetails
NamespaceIsolationProfile NamespaceIsolationProfile `json:"namespaceIsolationProfile,omitempty"`
ExternalGatewayConfig []ExternalGatewayConfig `json:"externalGatewayConfig,omitempty"`
//+kubebuilder:default:=16
//+kubebuilder:validation:Minimum=2
//+kubebuilder:validation:Maximum=32
MaxClusters int `json:"maxClusters"`
//+kubebuilder:default:=16
MaxClusters int `json:"maxClusters,omitempty"`
//+kubebuilder:validation:Minimum=30
//+kubebuilder:validation:Maximum=90
//+kubebuilder:default:=30
Expand Down Expand Up @@ -74,6 +74,17 @@ 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"`
}

// QOSProfile is the QOS Profile configuration from backend
Expand Down
3 changes: 3 additions & 0 deletions pkg/worker/v1alpha1/workersliceconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ 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"`
}

// QOSProfile is the QOS Profile configuration from backend
Expand Down
31 changes: 18 additions & 13 deletions pkg/worker/v1alpha1/workerslicegateway_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,27 @@ type WorkerSliceGatewaySpec struct {
//+kubebuilder:default:=OpenVPN
GatewayType string `json:"gatewayType,omitempty"`
//+kubebuilder:validation:Enum:=Client;Server
GatewayHostType string `json:"gatewayHostType,omitempty"`
GatewayCredentials GatewayCredentials `json:"gatewayCredentials,omitempty"`
LocalGatewayConfig SliceGatewayConfig `json:"localGatewayConfig,omitempty"`
RemoteGatewayConfig SliceGatewayConfig `json:"remoteGatewayConfig,omitempty"`
GatewayNumber int `json:"gatewayNumber,omitempty"`
GatewayHostType string `json:"gatewayHostType,omitempty"`
//+kubebuilder:default:=NodePort
//+kubebuilder:validation:Enum:=NodePort;LoadBalancer
GatewayConnectivityType string `json:"gatewayConnectivityType,omitempty"`
GatewayCredentials GatewayCredentials `json:"gatewayCredentials,omitempty"`
LocalGatewayConfig SliceGatewayConfig `json:"localGatewayConfig,omitempty"`
RemoteGatewayConfig SliceGatewayConfig `json:"remoteGatewayConfig,omitempty"`
GatewayNumber int `json:"gatewayNumber,omitempty"`
}

type SliceGatewayConfig struct {
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"`
//+kubebuilder:deprecatedversion:warning="worker/v1alpha1 NodeIp is deprecated...use NodeIps"
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

0 comments on commit 8be3403

Please sign in to comment.