From febec2d012f159b384568ab9b298d8a8c14caa72 Mon Sep 17 00:00:00 2001 From: Mridul Gain Date: Wed, 22 May 2024 12:23:35 +0530 Subject: [PATCH 1/2] sliceconfig api changes Signed-off-by: Mridul Gain --- apis/controller/v1alpha1/sliceconfig_types.go | 20 +++++++++++++------ .../v1alpha1/workersliceconfig_types.go | 9 ++++----- .../controller.kubeslice.io_sliceconfigs.yaml | 1 + ...orker.kubeslice.io_workersliceconfigs.yaml | 1 + 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/apis/controller/v1alpha1/sliceconfig_types.go b/apis/controller/v1alpha1/sliceconfig_types.go index 7cb39135..4a60a87d 100644 --- a/apis/controller/v1alpha1/sliceconfig_types.go +++ b/apis/controller/v1alpha1/sliceconfig_types.go @@ -38,6 +38,15 @@ const ( NONET NetworkType = "no-network" ) +// +kubebuilder:validation:Enum:=none;istio;envoy +type GatewayType string + +const ( + NONE GatewayType = "none" + ISTIO GatewayType = "istio" + ENVOY GatewayType = "envoy" +) + // SliceConfigSpec defines the desired state of SliceConfig type SliceConfigSpec struct { //+kubebuilder:default:=single-network @@ -69,12 +78,11 @@ type SliceConfigSpec struct { // ExternalGatewayConfig is the configuration for external gateways like 'istio', etc/ type ExternalGatewayConfig struct { - Ingress ExternalGatewayConfigOptions `json:"ingress,omitempty"` - Egress ExternalGatewayConfigOptions `json:"egress,omitempty"` - NsIngress ExternalGatewayConfigOptions `json:"nsIngress,omitempty"` - //+kubebuilder:validation:Enum:=none;istio - GatewayType string `json:"gatewayType,omitempty"` - Clusters []string `json:"clusters,omitempty"` + Ingress ExternalGatewayConfigOptions `json:"ingress,omitempty"` + Egress ExternalGatewayConfigOptions `json:"egress,omitempty"` + NsIngress ExternalGatewayConfigOptions `json:"nsIngress,omitempty"` + GatewayType GatewayType `json:"gatewayType,omitempty"` + Clusters []string `json:"clusters,omitempty"` } type ExternalGatewayConfigOptions struct { diff --git a/apis/worker/v1alpha1/workersliceconfig_types.go b/apis/worker/v1alpha1/workersliceconfig_types.go index 1de6b71a..e6ebedae 100644 --- a/apis/worker/v1alpha1/workersliceconfig_types.go +++ b/apis/worker/v1alpha1/workersliceconfig_types.go @@ -90,11 +90,10 @@ type NamespaceIsolationProfile struct { } type ExternalGatewayConfig struct { - Ingress ExternalGatewayConfigOptions `json:"ingress,omitempty"` - Egress ExternalGatewayConfigOptions `json:"egress,omitempty"` - NsIngress ExternalGatewayConfigOptions `json:"nsIngress,omitempty"` - //+kubebuilder:validation:Enum:=none;istio - GatewayType string `json:"gatewayType,omitempty"` + Ingress ExternalGatewayConfigOptions `json:"ingress,omitempty"` + Egress ExternalGatewayConfigOptions `json:"egress,omitempty"` + NsIngress ExternalGatewayConfigOptions `json:"nsIngress,omitempty"` + GatewayType controllerv1alpha1.GatewayType `json:"gatewayType,omitempty"` } type ExternalGatewayConfigOptions struct { diff --git a/config/crd/bases/controller.kubeslice.io_sliceconfigs.yaml b/config/crd/bases/controller.kubeslice.io_sliceconfigs.yaml index 89702616..ee2f18df 100644 --- a/config/crd/bases/controller.kubeslice.io_sliceconfigs.yaml +++ b/config/crd/bases/controller.kubeslice.io_sliceconfigs.yaml @@ -57,6 +57,7 @@ spec: enum: - none - istio + - envoy type: string ingress: properties: diff --git a/config/crd/bases/worker.kubeslice.io_workersliceconfigs.yaml b/config/crd/bases/worker.kubeslice.io_workersliceconfigs.yaml index c0cafd96..04a46a29 100644 --- a/config/crd/bases/worker.kubeslice.io_workersliceconfigs.yaml +++ b/config/crd/bases/worker.kubeslice.io_workersliceconfigs.yaml @@ -48,6 +48,7 @@ spec: enum: - none - istio + - envoy type: string ingress: properties: From e30a2da6445aef16cf231d051ef14dbb33062c73 Mon Sep 17 00:00:00 2001 From: Mridul Gain Date: Tue, 4 Jun 2024 12:35:31 +0530 Subject: [PATCH 2/2] api changes Signed-off-by: Mridul Gain --- apis/controller/v1alpha1/sliceconfig_types.go | 16 +++++++++++----- .../v1alpha1/zz_generated.deepcopy.go | 18 ++++++++++++++++++ .../worker/v1alpha1/workersliceconfig_types.go | 9 +++++---- apis/worker/v1alpha1/zz_generated.deepcopy.go | 1 + .../controller.kubeslice.io_sliceconfigs.yaml | 13 +++++++++++++ ...worker.kubeslice.io_workersliceconfigs.yaml | 13 +++++++++++++ 6 files changed, 61 insertions(+), 9 deletions(-) diff --git a/apis/controller/v1alpha1/sliceconfig_types.go b/apis/controller/v1alpha1/sliceconfig_types.go index 4a60a87d..56ba695b 100644 --- a/apis/controller/v1alpha1/sliceconfig_types.go +++ b/apis/controller/v1alpha1/sliceconfig_types.go @@ -78,11 +78,17 @@ type SliceConfigSpec struct { // ExternalGatewayConfig is the configuration for external gateways like 'istio', etc/ type ExternalGatewayConfig struct { - Ingress ExternalGatewayConfigOptions `json:"ingress,omitempty"` - Egress ExternalGatewayConfigOptions `json:"egress,omitempty"` - NsIngress ExternalGatewayConfigOptions `json:"nsIngress,omitempty"` - GatewayType GatewayType `json:"gatewayType,omitempty"` - Clusters []string `json:"clusters,omitempty"` + Ingress ExternalGatewayConfigOptions `json:"ingress,omitempty"` + Egress ExternalGatewayConfigOptions `json:"egress,omitempty"` + NsIngress ExternalGatewayConfigOptions `json:"nsIngress,omitempty"` + GatewayType GatewayType `json:"gatewayType,omitempty"` + Clusters []string `json:"clusters,omitempty"` + VPCServiceAccess ServiceAccess `json:"vpcServiceAccess,omitempty"` +} + +type ServiceAccess struct { + Ingress ExternalGatewayConfigOptions `json:"ingress,omitempty"` + Egress ExternalGatewayConfigOptions `json:"egress,omitempty"` } type ExternalGatewayConfigOptions struct { diff --git a/apis/controller/v1alpha1/zz_generated.deepcopy.go b/apis/controller/v1alpha1/zz_generated.deepcopy.go index 61214f2f..701d4708 100644 --- a/apis/controller/v1alpha1/zz_generated.deepcopy.go +++ b/apis/controller/v1alpha1/zz_generated.deepcopy.go @@ -210,6 +210,7 @@ func (in *ExternalGatewayConfig) DeepCopyInto(out *ExternalGatewayConfig) { *out = make([]string, len(*in)) copy(*out, *in) } + out.VPCServiceAccess = in.VPCServiceAccess } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalGatewayConfig. @@ -453,6 +454,23 @@ func (in *QOSProfile) DeepCopy() *QOSProfile { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceAccess) DeepCopyInto(out *ServiceAccess) { + *out = *in + out.Ingress = in.Ingress + out.Egress = in.Egress +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccess. +func (in *ServiceAccess) DeepCopy() *ServiceAccess { + if in == nil { + return nil + } + out := new(ServiceAccess) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ServiceAccount) DeepCopyInto(out *ServiceAccount) { *out = *in diff --git a/apis/worker/v1alpha1/workersliceconfig_types.go b/apis/worker/v1alpha1/workersliceconfig_types.go index e6ebedae..10043c69 100644 --- a/apis/worker/v1alpha1/workersliceconfig_types.go +++ b/apis/worker/v1alpha1/workersliceconfig_types.go @@ -90,10 +90,11 @@ type NamespaceIsolationProfile struct { } type ExternalGatewayConfig struct { - Ingress ExternalGatewayConfigOptions `json:"ingress,omitempty"` - Egress ExternalGatewayConfigOptions `json:"egress,omitempty"` - NsIngress ExternalGatewayConfigOptions `json:"nsIngress,omitempty"` - GatewayType controllerv1alpha1.GatewayType `json:"gatewayType,omitempty"` + Ingress ExternalGatewayConfigOptions `json:"ingress,omitempty"` + Egress ExternalGatewayConfigOptions `json:"egress,omitempty"` + NsIngress ExternalGatewayConfigOptions `json:"nsIngress,omitempty"` + GatewayType controllerv1alpha1.GatewayType `json:"gatewayType,omitempty"` + VPCServiceAccess controllerv1alpha1.ServiceAccess `json:"vpcServiceAccess,omitempty"` } type ExternalGatewayConfigOptions struct { diff --git a/apis/worker/v1alpha1/zz_generated.deepcopy.go b/apis/worker/v1alpha1/zz_generated.deepcopy.go index 51f6b2f4..ac6df83e 100644 --- a/apis/worker/v1alpha1/zz_generated.deepcopy.go +++ b/apis/worker/v1alpha1/zz_generated.deepcopy.go @@ -76,6 +76,7 @@ func (in *ExternalGatewayConfig) DeepCopyInto(out *ExternalGatewayConfig) { out.Ingress = in.Ingress out.Egress = in.Egress out.NsIngress = in.NsIngress + out.VPCServiceAccess = in.VPCServiceAccess } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalGatewayConfig. diff --git a/config/crd/bases/controller.kubeslice.io_sliceconfigs.yaml b/config/crd/bases/controller.kubeslice.io_sliceconfigs.yaml index ee2f18df..88c726df 100644 --- a/config/crd/bases/controller.kubeslice.io_sliceconfigs.yaml +++ b/config/crd/bases/controller.kubeslice.io_sliceconfigs.yaml @@ -69,6 +69,19 @@ spec: enabled: type: boolean type: object + vpcServiceAccess: + properties: + egress: + properties: + enabled: + type: boolean + type: object + ingress: + properties: + enabled: + type: boolean + type: object + type: object type: object type: array maxClusters: diff --git a/config/crd/bases/worker.kubeslice.io_workersliceconfigs.yaml b/config/crd/bases/worker.kubeslice.io_workersliceconfigs.yaml index 04a46a29..be8db824 100644 --- a/config/crd/bases/worker.kubeslice.io_workersliceconfigs.yaml +++ b/config/crd/bases/worker.kubeslice.io_workersliceconfigs.yaml @@ -60,6 +60,19 @@ spec: enabled: type: boolean type: object + vpcServiceAccess: + properties: + egress: + properties: + enabled: + type: boolean + type: object + ingress: + properties: + enabled: + type: boolean + type: object + type: object type: object ipamClusterOctet: type: integer