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

AM-13007: api update for no-network overlay deployment mode #32

Merged
merged 2 commits into from
Apr 1, 2024
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
3 changes: 3 additions & 0 deletions pkg/controller/v1alpha1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ type ClusterStatus struct {
RegistrationStatus RegistrationStatus `json:"registrationStatus,omitempty"`
// IsDeregisterInProgress is the flag to check if the cluster deregister is InProgress
IsDeregisterInProgress bool `json:"isDeregisterInProgress,omitempty"`
// NetworkPresent denotes if the networking components (NSM, Spire) are installed on a cluster
//+kubebuilder:default:=false
NetworkPresent bool `json:"networkPresent,omitempty"`

// VCPURestriction is the restriction on the cluster disabling the creation of new pods
VCPURestriction *VCPURestriction `json:"vCPURestriction,omitempty"`
Expand Down
27 changes: 20 additions & 7 deletions pkg/controller/v1alpha1/sliceconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,29 @@ 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
SliceGatewayProvider WorkerSliceGatewayProvider `json:"sliceGatewayProvider"`
SliceType string `json:"sliceType,omitempty"`
SliceGatewayProvider *WorkerSliceGatewayProvider `json:"sliceGatewayProvider,omitempty"`
//+kubebuilder:default:=Local
SliceIpamType string `json:"sliceIpamType,omitempty"`
Clusters []string `json:"clusters,omitempty"`
Expand All @@ -44,7 +57,7 @@ type SliceConfigSpec struct {
//+kubebuilder:validation:Minimum=2
//+kubebuilder:validation:Maximum=32
//+kubebuilder:default:=16
MaxClusters int `json:"maxClusters,omitempty"`
MaxClusters int `json:"maxClusters"`
//+kubebuilder:validation:Minimum=30
//+kubebuilder:validation:Maximum=90
//+kubebuilder:default:=30
Expand Down
6 changes: 5 additions & 1 deletion pkg/controller/v1alpha1/zz_generated.deepcopy.go

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

11 changes: 5 additions & 6 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 @@ -47,13 +48,11 @@ type WorkerSliceConfigSpec struct {
QosProfileDetails QOSProfile `json:"qosProfileDetails,omitempty"`
NamespaceIsolationProfile NamespaceIsolationProfile `json:"namespaceIsolationProfile,omitempty"`
IpamClusterOctet int `json:"ipamClusterOctet,omitempty"`
//+kubebuilder:validation:Required
Octet *int `json:"octet"`
ClusterSubnetCIDR string `json:"clusterSubnetCIDR,omitempty"`
ExternalGatewayConfig ExternalGatewayConfig `json:"externalGatewayConfig,omitempty"`
Octet *int `json:"octet,omitempty"`
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
Loading