Get A Quote

Book A Demo

Create a Kubernetes Cluster

2 min read

Overview

NiralOS EDGE supports connecting Kubernetes clusters for application orchestration and lifecycle management.

This guide explains two common ways to create a Kubernetes cluster:

Option 1: Create a lightweight Kubernetes cluster using K3s (Linux) 

Option 2: Enable Kubernetes in Docker Desktop (Windows/macOS)

Option 1: Create a Kubernetes Cluster Using K3s (Linux) #

K3s is a lightweight, CNCF-certified Kubernetes distribution designed for edge computing and resource-constrained environments.

Prerequisites #

  • Linux server (Ubuntu 22.04 LTS or later recommended) 
  • Internet connectivity 
  • At least 2 CPU cores 
  • 4 GB RAM 
  • Docker is not required

Step 1. Update the System #

sudo apt update
sudo apt upgrade -y

Step 2. Install K3s #

Run the installation script.

curl -sfL https://get.k3s.io | sh -

The installer automatically:

  • Installs Kubernetes 
  • Starts the K3s service 
  • Configures the control plane 
  • Generates the kubeconfig file

Step 3. Verify the Service #

Check the K3s service.

sudo systemctl status k3s

The service should display:

Active: active (running)

Step 4. Verify the Cluster #

List the nodes.

sudo kubectl get nodes

Example

NameStatusRolesAge
edge-nodeReadycontrol-plane, master2m

Step 5. Copy the KubeConfig #

Create the kubeconfig directory.

mkdir -p ~/.kube

Copy the kubeconfig.

sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config

Update ownership.

sudo chown $USER:$USER ~/.kube/config

Step 6. Verify Access #

Run:

kubectl cluster-info

You should see the Kubernetes control plane information.

Step 7: Connect the Kubernetes Cluster to NiralOS EDGE #

Once your Kubernetes cluster is up and running, connect it to NiralOS EDGE by deploying the NiralOS EDGE Agent. Choose one of the following deployment methods based on your cluster configuration.

Option A: Deploy Using LoadBalancer #

Use this option if your Kubernetes cluster has a LoadBalancer service available (for example, MetalLB, a cloud provider’s LoadBalancer, or any supported external load balancer).

Run:

kubectl apply -f https://downloads.portainer.io/ce2-33/portainer-agent-k8s-lb.yaml

Option B: Deploy Using NodePort #

Use this option if your Kubernetes cluster does not have a LoadBalancer service and you want to expose the NiralOS EDGE Agent using a NodePort service.

Run:

kubectl apply -f https://downloads.portainer.io/ce2-33/portainer-agent-k8s-nodeport.yaml

Connect The Cluster #

After deploying the NiralOS EDGE Agent, open the Add Environment page in the NiralOS EDGE dashboard. Enter your Kubernetes Cluster IP (for example, 192.168.0.42) in the Kubernetes Cluster IP field, and then click Connect.

NiralOS EDGE will automatically connect to your Kubernetes cluster. After the connection is established successfully, the cluster will appear under the Kubernetes Environments section, where you can monitor and manage your Kubernetes resources.

Option 2: Create a Kubernetes Cluster Using Docker Desktop #

Docker Desktop includes a built-in single-node Kubernetes cluster, ideal for development and testing.

Prerequisites #

  • Docker Desktop installed 
  • Kubernetes feature available 
  • Minimum 4 GB RAM allocated to Docker Desktop

Step 1: Open Docker Desktop #

Launch Docker Desktop.

Wait until Docker Engine is running.

Step 2: Enable Kubernetes #

  1. Open Settings
  2. Navigate to Kubernetes
  3. Enable Enable Kubernetes
  4. Click Apply & Restart

Docker Desktop will download the required Kubernetes images and initialize the cluster.

This process may take several minutes.

Step 3: Verify the Cluster #

Open a terminal or PowerShell.

Run:

kubectl get nodes

Example: docker-desktop   Ready   control-plane

Step 4: Locate the KubeConfig #

The kubeconfig file is automatically generated.

Windows: C:\Users\<username>\.kube\config

macOS: ~/.kube/config

Step 5: Verify Cluster Connectivity #

Run:

kubectl cluster-info

The Kubernetes control plane information should be displayed.

Step 6: Connect the Cluster to NiralOS EDGE #

  1. Open Infrastructure → Environments
  2. Select Add Kubernetes
  3. Enter the Kubernetes API Server IP. 
  4. Upload the kubeconfig file. 
  5. Click Check Connection
  6. Provide an Environment Name. 
  7. Click Finish

NiralOS EDGE deploys its Edge Agent to the cluster, exposing it through a NodePort service to enable secure communication between the orchestrator and the Kubernetes environment.

Cluster Ready #

Your Kubernetes cluster is now ready for use with NiralOS EDGE. You can begin deploying and managing workloads, monitor cluster resources, and orchestrate containerized applications directly from the NiralOS EDGE dashboard.