Skip to content

Commit

Permalink
API changes for Vpc Service access (#209)
Browse files Browse the repository at this point in the history
* api changes

Signed-off-by: Mridul Gain <[email protected]>
  • Loading branch information
mridulgain authored Jun 20, 2024
1 parent 9e7b06f commit 8182492
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 11 deletions.
26 changes: 20 additions & 6 deletions apis/controller/v1alpha1/sliceconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -69,12 +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"`
//+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"`
VPCServiceAccess ServiceAccess `json:"vpcServiceAccess,omitempty"`
}

type ServiceAccess struct {
Ingress ExternalGatewayConfigOptions `json:"ingress,omitempty"`
Egress ExternalGatewayConfigOptions `json:"egress,omitempty"`
}

type ExternalGatewayConfigOptions struct {
Expand Down
18 changes: 18 additions & 0 deletions apis/controller/v1alpha1/zz_generated.deepcopy.go

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

10 changes: 5 additions & 5 deletions apis/worker/v1alpha1/workersliceconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ 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"`
VPCServiceAccess controllerv1alpha1.ServiceAccess `json:"vpcServiceAccess,omitempty"`
}

type ExternalGatewayConfigOptions struct {
Expand Down
1 change: 1 addition & 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.

14 changes: 14 additions & 0 deletions config/crd/bases/controller.kubeslice.io_sliceconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ spec:
enum:
- none
- istio
- envoy
type: string
ingress:
properties:
Expand All @@ -68,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:
Expand Down
14 changes: 14 additions & 0 deletions config/crd/bases/worker.kubeslice.io_workersliceconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ spec:
enum:
- none
- istio
- envoy
type: string
ingress:
properties:
Expand All @@ -59,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
Expand Down

0 comments on commit 8182492

Please sign in to comment.