Skip to main content
Version: 1.14.0

Cluster Operations

This topic describes how to use the KubeSlice Manager to register clusters with the KubeSlice Controller. A cluster can be registered in two ways. You can register the cluster either automatically or manually. In automated mode, the Slice Operator is installed on the cluster automatically by KubeSlice. In manual mode, you must install the Slice Operator on the worker cluster using Helm for the registration to be successful.

KubeSlice uses Prometheus to collect events and metrics. To view metrics on the dashboard, you can enter the Prometheus URL during cluster registration if Prometheus is already installed on it. The Prometheus URL can also be updated after cluster registration by editing a cluster.

info

To install Prometheus and get the Prometheus URL, follow the instructions in the Install Prometheus section.

Register a Worker Cluster

warning

Limit the cluster name and slice name to 15 characters or fewer, as exceeding the limit results in a service export error.

To register a cluster:

  1. Go to Clusters on the left sidebar.

  2. On the Clusters page, click the Add Cluster button on the top-right corner.

Automated Method

To register a new worker cluster with the KubeSlice Controller, follow these steps:

  1. Obtain the kubeconfig file of the worker cluster.

  2. Use the kubeconfig file to register the worker cluster with the controller.

  3. During the registration process, KubeSlice will automatically install the Slice Operator on the worker cluster.

  4. Keep in mind that each worker cluster can have only one Slice Operator installed on it.

note

If you are in an air-gapped scenario or if you need to install a custom helm repository or a specific version of the worker chart, you can customize the config map for worker-chart-options. For more detailed information, refer to Air-Gapped Installation.

  1. Under Register Cluster, select the Automated mode.

  2. Click Next to add cluster details.

  3. In the Add KubeConfig file section, enter the following information:

    • Enter the name of the cluster in the Name of the Cluster text box.

    • Drag and drop the kubeconfig file or Click here to upload the kubeconfig file.

      register

    • Install KubeSlice overlay networking components is enabled by default, which is useful while switching from a no-network to single/multi-network slice.

      warning

      If you set enabled: false under kubesliceNetworking on a cluster that's already connected to a a slice, then there will be disruption in that slice behavior.

  4. (Optional) Click Show advanced options and enter the following information:

    • KubeSlice detects the Node IP for nodes labeled kubeslice.io/node-type=gateway. You can leave it blank. You can enter a specific Node IP during cluster registration, but make sure KubeSlice has access to it.

      note

      We currently support IPv4 and IPv6 for node IP addresses.

    • Enter the URL of Prometheus that is installed on your cluster in the Prometheus URL text box.

  5. Click the Import Cluster button to register a cluster.

    The status of the cluster changes from In progress to Registered after all the Slice Operator components are up and running. You can view the progress of the cluster registration by clicking the logs (file) icon.

    register

    The following figure illustrates that the cluster is registered with the controller. The status changes to Registered after all the Slice Operator components are up and running.

    register

Air-Gapped Installation

You can edit or modify the worker-chart-options parameters in the ConfigMap file located in the kubeslice-controller namespace in the controller cluster for a customized worker installation.

To edit a ConfigMap file:

  1. Switch the context to controller cluster:

    kubectx <controller cluster-name>
  2. Switch to the kubeslice-controller namespace.

  3. Edit the ConfigMap using the following command:

    kubectl edit configmap worker-chart-options

    The following are the customization options supported:

    workerChartOptions:
    metricsInsecure: # [Optional] Default is false. Set to true if required to disable TLS for metrics server.
    repository: # [Optional] Helm repository URL for worker charts. Default is `https://kubeslice.aveshalabs.io/repository/kubeslice-helm-ent-prod/`
    releaseName: # [Optional] Release name of kubeslice-worker. Default is `kubeslice-worker`
    chartName: # [Optional] Name of the chart. Default is `kubeslice-worker`
    chartVersion: # [Optional] Version of the chart. Default is the latest version
    debug: # [Optional] Default is false. Set to true if required to enable debug logs for kubeslice-worker
    helmCredentials:
    username: # [Optional]
    password: # [Optional]
    imagePullSecrets:
    repository: # [Optional]
    username: # [Optional]
    password: # [Optional]
    email: # [Optional]

Manual Method

Register a new worker cluster with the KubeSlice Controller by entering the cluster name, the cloud name, and the cluster Kube API endpoint parameters during cluster registration. The Node IP and the Prometheus URL are optional parameters.

Registration Inputs
Cluster Name
Cloud Name
Cluster Kube API Endpoint
(Optional) Enter the Node IP
(Optional) Enter the Prometheus URL

To register a cluster:

  1. Under Register Clusters, select the Manual mode.

  2. Click Next to add cluster details.

  3. In the Add Cluster Details section, enter the following information:

    • Select the cloud from the Name of the Cloud drop-down list. The saved value is immutable.

    • Enter a name for a worker cluster in the Name of the cluster text box. The saved value is immutable.

    • Enter the control plane's kube-apiserver endpoint of the cluster in the Cluster Kube API Endpoint text box. Run this command on the cluster to get the endpoint: kubectl cluster-info.

    register

    info

    You can skip Step 4 and proceed to Step 6 to generate the values file.

  4. (Optional) Click Show advanced options and enter the following information:

    • KubeSlice detects the latitude and longitude coordinates of the cluster's geographical location.

    • KubeSlice detects the Node IP for nodes labeled kubeslice.io/node-type=gateway. You can leave it blank. You can enter the specific Node IP during cluster registration, but make sure KubeSlice has access to it.

      note

      We currently support IPv4 and IPv6 for node IP addresses.

    • Enter the URL of Prometheus that is installed on your cluster in the Prometheus URL text box.

Download the Slice Operator Values File

  1. Click Generate Credentials to generate the values file. The values file is downloaded automatically. Save the file for later use.
note

The values file contains the worker secrets from the controller cluster, and the file is created with the cluster name that you entered in step 3.

register

  1. (Optional) In the Cluster Registration Procedure section, click the download link if the values file does not download automatically.

Copy Helm Command

  1. Copy the Helm command to install the Slice Operator and Click Done.

Registration Status

The worker cluster's status on the Clusters page will be Awaiting User Action until the Slice Operator is installed on it. The status changes to Registered after you install the Slice Operator on the worker cluster, which shows that the cluster has been successfully registered.

Edit the Values File

Edit the values file you downloaded in step 5 of Register a Worker Cluster. Fill in the image pull secrets. Enter the username, password, and the email address. The email address is optional.

imagePullSecrets:
repository: https://index.docker.io/v1/ # image registry url. Modify if using a private registry
username: # username for image registry
password: # password for image registry
email: ""

In the values file, the following property is enabled by default, which is required to switch from a no-network slice to a single/multi-network slice:

kubesliceNetworking:
enabled: true
info

You can disable this property for a no-network slice only when you do not want to switch it to a single/multi-network slice.

This property must remain enabled to establish communication between the clusters on a slice.

warning

If you set enabled: false under kubesliceNetworking on a cluster that's already connected to a a slice, then there will be disruption in that slice behavior.

The following is an example values file after you fill in the image pull secrets.

namespace: a3ViZXNsaWNlLWF2ZXNoYQ==
endpoint: aHR0cHM6Ly9DNjgwNTQ5MUNBNTI2MzVFM0YzNEUwQTFDRTRDMkY3RS5ncjcudXMtZWFzdC0xLmVrcy5hbWF6b25hd3MuY29t
ca.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM1ekNDQWMrZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkF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hNaUlzSW5OMVlpSTZJbk41YzNSbGJUcHpaWEoyYVdObFlXTmpiM1Z1ZERwcmRXSmxjMnhwWTJVdFlYWmxjMmhoT210MVltVnpiR2xqWlMxeVltRmpMWGR2Y210bGNpMW5hMlV0ZDI5eWEyVnlMVEVpZlEuRVNkVm1vajA3OXBrSmkzbktGMFhuZE9sa2Q4aGJJdUNaLURpdG1UOGZkVmRkeGhPWEdfcVFSSXZqN05tb1JMUC1xdzJacHliZmgtYWJRVUtNSHFTTGM0aFNBMFhaTTI2UnprWUpRZU9NUE80dGdqdjVQaWNYRkJDbFo0Vk93d2V0WE5Ldi1TLVhiOWVYeHBGQjVDZUozVm0tZjlBV2xXZkMzLUg3aTBoZVlXaWdOSU85SEFFeU43b1RtYXV3WFRRRUg3YVlNOURpZmRreHNaTjZyeTlPZ09TbzJMcUQyc2F2bzNVSU5iX3d6bzdkc2t3T0NuZjdOQk1pMzJOYmZTZ2dBaFdNOUVFM0hyUzFXMWgzZEJLZURMZjEzNXVGZjB4N29NM2lfSUliTzNnZlhYaDVKN3UwS1RIYXNvVFRwVFJhY29NVWkzZ3lnaFN5R0Y0dmVXSzZB
cluster:
name: worker1
endpoint: https://34.86.154.17:6444
netop:
networkInterface: eth0
kubesliceNetworking:
enabled: true
imagePullSecrets:
repository: https://index.docker.io/v1/
username: Kumar
password: 5585799-5d5a-48fa-b805-f4a1ffb110
email: aveshaenterprise@gmail.com

Install the Slice Operator

You must install the Slice Operator on the cluster to register it with the KubeSlice Controller. Install the Slice Operator using the values or secrets file that you downloaded in step 5 of Register a Worker Cluster.

info
  • You need cluster administrative privileges to install the Slice Operator.
  • To know more about the Slice Operator and its functions, see KubeSlice Components.

To install the Slice Operator:

  1. Switch the context to the worker cluster using the following command:

    kubectx <cluster name>
  2. Run the command you copied in step 5 of Register a Worker Cluster.

    Example

    helm upgrade -i kubeslice-worker kubeslice/kubeslice-worker --namespace kubeslice-system --create-namespace -f /<path-to-file>/mars-secret.yaml

Validate the Installation

To validate the Slice Operator installation on a cluster, check the status of the pods that belong to the kubeslice-system namespace.

Use the following command to check if the pods are running:

kubectl get pods -n kubeslice-system

Example Output

NAME                                         READY   STATUS      RESTARTS   AGE
forwarder-kernel-94c8q 1/1 Running 0 8h
kubeslice-dns-679966fd4c-4ppdb 1/1 Running 0 8h
kubeslice-netop-plz52 1/1 Running 0 8h
kubeslice-operator-77fc84cb54-9j2jm 2/2 Running 0 4h36m
nsm-admission-webhook-k8s-864c87f5d4-cqlxn 1/1 Running 0 8h
nsm-install-crds-lbvrx 0/1 Completed 0 2m35s
nsmgr-zqzzg 2/2 Running 0 8h
registry-k8s-84f468f675-g9hzg 1/1 Running 0 8h
spire-install-clusterid-cr-488p6 0/1 Completed 0 2m21s
spire-install-crds-dcm75 0/1 Completed 0 2m28s

The status changes to Registered after all the Slice Operator components are up and running. The following figure illustrates that the cluster is registered with the controller and KubeSlice has detected the Node IP for the registered worker cluster.

register

If the Node IP is not detected during cluster registration, the Clusters page displays an error icon for that cluster. The following figure illustrates that Kubeslice could not detect the Node IP for cluster3. You can update the correct Node IP by editing a cluster.

Event Notification

The event notifications are issued on the Notifications page, you can check out the events that have been received across clusters, slices, and their components.

To view the event notification for a cluster:

  1. Click on the bell icon on the top right corner.

    event

  2. On the Notifications page, in the Events section, select the cluster from the drop-down list.

    event

  3. Click the > icon at the right for the event to see the details.

    The following figure illustrates the Events Details for the doc-eks-worker cluster.

    event

Edit a Cluster

To edit a cluster:

  1. Go to Clusters on the left sidebar.

  2. On the Clusters page, click the edit icon for the cluster to change any configuration.

    info

    The names of the cluster and the cloud are immutable.

    edit

  3. Update the values. You can only edit the Cluster Kube API Endpoint, the Node IP, and the Prometheus URL values.

    info

    If you enter the specific Node IP, it takes precedence over any Node IP that KubeSlice detects. If the value of the Node IP is empty, you see the error KubeSlice could not detect a Node IP. You must enter one..

  4. Click Edit Cluster to save the settings.

Deregister a Worker Cluster

A cluster can only be deregistered (deleted) from KubeSlice when it is not a part of any slice. If the cluster is part of any slice you must detach the cluster from the slice and delete cluster to deregister it.

If you try to deregister a cluster that is part of any slice, you get the following message:

detach

Follow these steps to deregister a worker cluster:

  1. Detach a worker cluster from a slice.
  2. Delete a worker cluster.

Detach a Worker Cluster

To detach a worker cluster from a slice:

  1. Go to Slices on the left sidebar.

  2. Click the > icon at the right for the slice from which you want to detach a cluster.

  3. Click the edit icon at the right.

    detach

  4. Click the Edit Slice button.

  5. In the Connect Clusters tab, under Slice Clusters, click the minus icon for the cluster you want to detach. For example, detach the gke cluster from the red slice.

    detach

  6. Enter the text DETACH, and then click the Detach Cluster button.

    note

    Detaching a cluster from a slice might take some time, depending on the underlying resources.

    The following figure illustrates that the Detach Cluster process is in progress.

    detach

Automated Method

To delete a worker cluster from the KubeSlice Controller:

  1. Go to Cluster on the left sidebar.

  2. On the Clusters page, click the delete icon for the cluster that you want to delete.

    deregister

  3. Enter the text DELETE to confirm, and then click the Delete Cluster button.

    After you deregister the cluster from the KubeSlice Controller, the cluster is removed from the Clusters page.

Manual Method

To delete a worker cluster from the KubeSlice Controller, you must uninstall the Slice Operator from it.

Uninstall the Slice Operator

  1. Switch the context to the worker cluster using the following command:

    kubectx <cluster name>
  2. Uninstall the Slice Operator using the following command:

    helm uninstall [RELEASE_NAME] -n kubeslice-system

Delete CRDs

  1. Delete the CRDs of the Slice Operator using the following commands:

    kubectl delete crd serviceexports.networking.kubeslice.io
    kubectl delete crd serviceimports.networking.kubeslice.io
    kubectl delete crd slices.networking.kubeslice.io
    kubectl delete crd slicegateways.networking.kubeslice.io
    kubectl delete crd sliceresourcequotas.networking.kubeslice.io
    kubectl delete crd slicerolebindings.networking.kubeslice.io
    kubectl delete crd slicenodeaffinities.networking.kubeslice.io
  2. Delete the kubeslice-system namespace using the following command:

    kubectl delete ns kubeslice-system

After you uninstall the Slice Operator, deregister a worker cluster from the KubeSlice Controller by deleting it from the Register Clusters page.

Delete a Cluster

To delete or deregister a worker cluster:

  1. Go to Clusters on the left sidebar.

  2. On the Clusters page, click the delete icon for the cluster that you want to delete.

    deregister

  3. Enter DELETE to confirm, and then click the Delete Cluster button.