Skip to main content
Version: 0.7.0

Create a Slice

The YAML file to create a slice for the registered kind worker clusters are described in this topic.

Create the Slice YAML File

After successfully registering the worker clusters with the KubeSlice Controller, create a slice to onboard your application namespaces. You can create a slice across the multiple clusters or intra-cluster.

Slice Configuration

Create the slice configuration .yaml file using the following template.

info

If you want to add a standard QoS profile configuration for multiple slices, create a standard QoS profile. Add the name of the external QoS profile as the value of standardQosProfileName in the slice configuration YAML file.

In a slice configuration YAML file, the standardQosProfileName parameter and the qosProfileDetails object are mutually exclusive.

info

To understand more about the configuration parameters, see Slice Configuration Parameters.

apiVersion: controller.kubeslice.io/v1alpha1
kind: SliceConfig
metadata:
name: <SLICENAME> # water
namespace: kubeslice-<project name>
spec:
sliceSubnet: 10.1.0.0/16
maxClusters: <2 - 32> #Ex: 5. By default, the maxClusters value is set to 16
sliceType: Application
sliceGatewayProvider:
sliceGatewayType: OpenVPN
sliceCaType: Local
sliceIpamType: Local
clusters:
- <worker cluster 1> # kind-worker-1
- <worker cluster 2> # kind-worker-2
qosProfileDetails:
queueType: HTB
priority: 1
tcType: BANDWIDTH_CONTROL
bandwidthCeilingKbps: 5120
bandwidthGuaranteedKbps: 2560
dscpClass: AF11
namespaceIsolationProfile:
applicationNamespaces:
- namespace: iperf
clusters:
- '*'
isolationEnabled: false #make this true in case you want to enable isolation
allowedNamespaces:
- namespace: kube-system
clusters:
- '*'

Apply the Slice Configuration on the Controller Cluster

The following information is required to apply the slice configuration.

VariableDescription
<cluster name>The name of the cluster.
<slice configuration>The name of the slice configuration file.
<project name>The project name on which you apply the slice configuration file.

You must apply the slice configuration .yamlfile on the project name.

Switch context to the KubeSlice Controller using the following command:

kubectx <cluster name>

Run the following command to apply the YAML file on the project:

kubectl apply -f <slice-configuration>.yaml -n kubeslice-<project name>
success

You have successfully created a slice with the registered clusters. All the slice configuration are applied at the KubeSlice Controller level.

Create a QoS Profile

The slice configuration file contains a QoS profile object. To apply a QoS profile to multiple slices, you can create a separate QOS profile YAML file and call it out in other slice configuration.

Validate the Slice

Validate the slice configuration on the controller and worker clusters.

Validate the Slice Configuration from the Controller Cluster

Validate the slice configuration from the controller cluster using the following command:

kubectl get sliceconfig -n kubeslice-<project name>

Expected Output

NAME    AGE
water 35s

Validate the slice configuration in the KubeSlice Controller using the following command:

kubectl get workersliceconfig -n kubeslice-<project name>

Example

kubectl get workerslicegateway -n kubeslice-avesha

Expected Output

NAME                                              AGE
water-dev-worker-cluster-1-dev-worker-cluster-2 45s
water-dev-worker-cluster-2-dev-worker-cluster-1 45s

Validate the Slice Configuration from the Worker Cluster

Validate the slice creation on the worker clusters using the following command on each worker cluster:

kubectl get slice -n kubslice-system

Example Output

NAME    AGE
water 45s

Validate the slice gateway on each worker cluster using the following command:

kubectl get slicegw -n kubeslice-system

Example Output

NAME                                SUBNET        REMOTE SUBNET   REMOTE CLUSTER   GW STATUS
water-kind-worker-1-kind-worker-2 10.1.1.0/24 10.1.2.0/24 kind-worker-2