Skip to content

Commit

Permalink
AM-13007: api update for no-network overlay deployment mode
Browse files Browse the repository at this point in the history
Signed-off-by: Mridul Gain <mridulgain@gmail.com>
  • Loading branch information
mridulgain committed Mar 7, 2024
1 parent 115db71 commit 61ec44f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
20 changes: 17 additions & 3 deletions pkg/controller/v1alpha1/sliceconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,26 @@ import (
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// +kubebuilder:validation:Enum:=single-network;multi-network;no-network
type NetworkType string

const (
// all workloads would be connected to the slice l3 overlay network
SINGLENET NetworkType = "single-network"

// workloads would be connected at l7 through network of envoy gateways.
// And the gateways would be connected through slice l3 overlay
MULTINET NetworkType = "multi-network"

// slice without any connectivity between clusters
NONET NetworkType = "no-network"
)

// SliceConfigSpec defines the desired state of SliceConfig
type SliceConfigSpec struct {
//+kubebuilder:default:=single-network
//+kubebuilder:validation:Enum:=single-network;multi-network
OverlayNetworkDeploymentMode string `json:"overlayNetworkDeploymentMode,omitempty"`
SliceSubnet string `json:"sliceSubnet,omitempty"`
OverlayNetworkDeploymentMode NetworkType `json:"overlayNetworkDeploymentMode,omitempty"`
SliceSubnet string `json:"sliceSubnet,omitempty"`
//+kubebuilder:default:=Application
SliceType string `json:"sliceType,omitempty"`
// +kubebuilder:validation:Required
Expand Down
4 changes: 2 additions & 2 deletions pkg/worker/v1alpha1/workersliceconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package v1alpha1

import (
controllerv1alpha1 "github.com/kubeslice/apis/pkg/controller/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -52,8 +53,7 @@ type WorkerSliceConfigSpec struct {
ClusterSubnetCIDR string `json:"clusterSubnetCIDR,omitempty"`
ExternalGatewayConfig ExternalGatewayConfig `json:"externalGatewayConfig,omitempty"`
//+kubebuilder:default:=single-network
//+kubebuilder:validation:Enum:=single-network;multi-network
OverlayNetworkDeploymentMode string `json:"overlayNetworkDeploymentMode,omitempty"`
OverlayNetworkDeploymentMode controllerv1alpha1.NetworkType `json:"overlayNetworkDeploymentMode,omitempty"`
}

// WorkerSliceGatewayProvider defines the configuration for slicegateway
Expand Down

0 comments on commit 61ec44f

Please sign in to comment.