Skip to content

Commit

Permalink
feat(): no-network slice (#344)
Browse files Browse the repository at this point in the history
* feat(): api changes for no-net slice

Signed-off-by: Mridul Gain <mridulgain@gmail.com>

* feat(): block reconcilation of networking part

Signed-off-by: Mridul Gain <mridulgain@gmail.com>

* cluster reconciler changes for no net

Signed-off-by: Mridul Gain <mridulgain@gmail.com>

* skip workerslice health for no-net deployment

Signed-off-by: Mridul Gain <mridulgain@gmail.com>

* update slice reconciler for no-net

Signed-off-by: Mridul Gain <mridulgain@gmail.com>

* fix(): update cluster status to show network present or not

Signed-off-by: Mridul Gain <mridulgain@gmail.com>

* fix(): ITs & go version update

Signed-off-by: Mridul Gain <mridulgain@gmail.com>

* fix(): update apis tag

Signed-off-by: Mridul Gain <mridulgain@gmail.com>

---------

Signed-off-by: Mridul Gain <mridulgain@gmail.com>
  • Loading branch information
mridulgain authored Apr 1, 2024
1 parent b0719d3 commit fe56202
Show file tree
Hide file tree
Showing 41 changed files with 719 additions and 293 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
##########################################################

# Build the manager binary
FROM golang:1.20 as builder
FROM golang:1.22.1 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 1.21.5
VERSION ?= latest

# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
Expand Down Expand Up @@ -159,7 +159,7 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
.PHONY: controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.7.0)
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@latest)

KUSTOMIZE = $(shell pwd)/bin/kustomize
.PHONY: kustomize
Expand Down
11 changes: 6 additions & 5 deletions api/v1beta1/slice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package v1beta1

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

Expand Down Expand Up @@ -56,13 +57,13 @@ type SliceConfig struct {
// display name of the slice.
SliceDisplayName string `json:"sliceDisplayName"`
// IP subnet range of the slice.
SliceSubnet string `json:"sliceSubnet"`
SliceSubnet string `json:"sliceSubnet,omitempty"`
// Type of the slice.
SliceType string `json:"sliceType"`
// QOS profile details
QosProfileDetails QosProfileDetails `json:"qosProfileDetails"`
QosProfileDetails QosProfileDetails `json:"qosProfileDetails,omitempty"`
// IPAM configuration for the slice
SliceIpam SliceIpamConfig `json:"sliceIpam"`
SliceIpam SliceIpamConfig `json:"sliceIpam,omitempty"`
// ExternalGatewayConfig determines istio ingress/egress configuration
ExternalGatewayConfig *ExternalGatewayConfig `json:"externalGatewayConfig,omitempty"`
// Namespace Isolation profile contains fields related to namespace binding to slice
Expand All @@ -73,8 +74,8 @@ type SliceConfig struct {
SliceGatewayServiceType string `json:"sliceGatewayServiceType,omitempty"`
// SliceGateway Protocol Type: UDP or TCP
SliceGatewayProtocol string `json:"sliceGatewayProtocol,omitempty"`
// Slice overlay network deployment mode: single-network or multi-network
SliceOverlayNetworkDeploymentMode string `json:"sliceOverlayNetworkDeploymentMode,omitempty"`
// Slice overlay network deployment mode: single-network, multi-network or no-network
SliceOverlayNetworkDeploymentMode controllerv1alpha1.NetworkType `json:"sliceOverlayNetworkDeploymentMode,omitempty"`
}

// NamespaceIsolationProfile defines the namespace isolation policy for the slice
Expand Down
1 change: 0 additions & 1 deletion api/v1beta1/zz_generated.deepcopy.go

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

77 changes: 39 additions & 38 deletions config/crd/bases/networking.kubeslice.io_serviceexports.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: serviceexports.networking.kubeslice.io
spec:
group: networking.kubeslice.io
Expand Down Expand Up @@ -46,23 +44,29 @@ spec:
description: ServiceExport is the Schema for the serviceexports API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: ServiceExportSpec defines the desired state of ServiceExport
properties:
aliases:
description: Alias names for the exported service. The service could
be addressed by the alias names in addition to the slice.local name.
description: |-
Alias names for the exported service. The service could be addressed by the alias names
in addition to the slice.local name.
items:
type: string
type: array
Expand All @@ -84,8 +88,9 @@ spec:
type: string
protocol:
default: TCP
description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults
to "TCP".
description: |-
Protocol for port. Must be UDP, TCP, or SCTP.
Defaults to "TCP".
type: string
servicePort:
description: Port number of the exported service
Expand Down Expand Up @@ -114,24 +119,24 @@ spec:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that
contains values, a key, and an operator that relates the key
and values.
description: |-
A label selector requirement is a selector that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to
a set of values. Valid operators are In, NotIn, Exists
and DoesNotExist.
description: |-
operator represents a key's relationship to a set of values.
Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values. If the
operator is In or NotIn, the values array must be non-empty.
If the operator is Exists or DoesNotExist, the values
array must be empty. This array is replaced during a strategic
description: |-
values is an array of string values. If the operator is In or NotIn,
the values array must be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
Expand All @@ -144,13 +149,13 @@ spec:
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator
is "In", and the values array contains only "value". The requirements
are ANDed.
description: |-
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions, whose key field is "key", the
operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
slice:
description: Slice denotes the slice which the app is part of
type: string
Expand All @@ -163,8 +168,9 @@ spec:
description: ServiceExportStatus defines the observed state of ServiceExport
properties:
aliases:
description: Alias names for the exported service. The service could
be addressed by the alias names in addition to the slice.local name.
description: |-
Alias names for the exported service. The service could be addressed by the alias names
in addition to the slice.local name.
items:
type: string
type: array
Expand All @@ -178,8 +184,9 @@ spec:
description: ExportStatus denotes the export status of the service
type: string
exposedPorts:
description: ExposedPorts shows a one line representation of ports
and protocols exposed only used to show as a printercolumn
description: |-
ExposedPorts shows a one line representation of ports and protocols exposed
only used to show as a printercolumn
type: string
ingressGwEnabled:
description: IngressGwEnabled denotes ingress gw is enabled for the
Expand Down Expand Up @@ -235,9 +242,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
42 changes: 21 additions & 21 deletions config/crd/bases/networking.kubeslice.io_serviceimports.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: serviceimports.networking.kubeslice.io
spec:
group: networking.kubeslice.io
Expand Down Expand Up @@ -40,23 +38,29 @@ spec:
description: ServiceImport is the Schema for the serviceimports API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: ServiceImportSpec defines the desired state of ServiceImport
properties:
aliases:
description: Alias names for the exported service. The service could
be addressed by the alias names in addition to the slice.local name.
description: |-
Alias names for the exported service. The service could be addressed by the alias names
in addition to the slice.local name.
items:
type: string
type: array
Expand All @@ -77,8 +81,9 @@ spec:
type: string
protocol:
default: TCP
description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults
to "TCP".
description: |-
Protocol for port. Must be UDP, TCP, or SCTP.
Defaults to "TCP".
type: string
servicePort:
description: Port number of the exported service
Expand Down Expand Up @@ -143,8 +148,9 @@ spec:
type: object
type: array
exposedPorts:
description: ExposedPorts shows a one line representation of ports
and protocols exposed only used to show as a printercolumn
description: |-
ExposedPorts shows a one line representation of ports and protocols exposed
only used to show as a printercolumn
type: string
importStatus:
description: ImportStatus denotes the status of the imported service
Expand All @@ -163,9 +169,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
27 changes: 12 additions & 15 deletions config/crd/bases/networking.kubeslice.io_slicegateways.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: slicegateways.networking.kubeslice.io
spec:
group: networking.kubeslice.io
Expand Down Expand Up @@ -38,14 +36,19 @@ spec:
description: SliceGateway is the Schema for the slicegateways API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down Expand Up @@ -223,9 +226,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading

0 comments on commit fe56202

Please sign in to comment.