Setting Up Cilium CNI Plugin on a Multi-Node Kubernetes Cluster Using Kind

Setting Up Cilium CNI Plugin on a Multi-Node Kubernetes Cluster Using Kind

ยทPavan Kalyan Meda

Learn how to create a multi-node Kind Kubernetes cluster, disable the default CNI, and install Cilium for high-performance networking and security.

Setting Up Cilium CNI Plugin on a Two-Node Kubernetes Cluster Using Kind

Introduction

Container networking is a fundamental component of Kubernetes. Every pod requires network connectivity to communicate with other pods, services, and external resources. This connectivity is provided through a Container Network Interface (CNI) plugin.

In this guide, you'll learn how to build a local two-node Kubernetes cluster using Kind (Kubernetes in Docker), disable the default networking configuration, and install Cilium as the cluster's CNI plugin.

By the end of this tutorial, you'll have a fully functional multi-node Kubernetes environment running locally, allowing you to explore advanced networking, security policies, and observability features provided by Cilium.

Important: Include only one architecture diagram showing the overall setup: Docker โ†’ Kind Cluster โ†’ Control Plane + Worker Node โ†’ Cilium CNI. This provides readers with a clear overview while keeping documentation size small.


Understanding the Core Concepts

Before setting up the cluster, it's helpful to understand the technologies used throughout this guide.


What Is Cilium?

Definition

Cilium is an open-source cloud-native networking, observability, and security solution designed for Kubernetes and other container platforms.

Unlike traditional networking solutions, Cilium uses eBPF (Extended Berkeley Packet Filter) to provide high-performance networking and security directly within the Linux kernel.


Why Use Cilium?

Cilium provides several advanced capabilities, including:

  • High-performance container networking
  • Kubernetes Network Policies
  • Layer 3, Layer 4, and Layer 7 security
  • Service load balancing
  • Network observability
  • Traffic visibility and monitoring
  • Scalability for cloud-native workloads

These capabilities make Cilium one of the most widely adopted CNI plugins for Kubernetes.


Example

Imagine a fleet of delivery trucks transporting packages between warehouses.

Cilium acts as the intelligent traffic control system that:

  • Routes traffic efficiently.
  • Prevents unauthorized communication.
  • Monitors every delivery.
  • Ensures secure communication between all locations.

What Is CNI?

Definition

Container Network Interface (CNI) is an industry-standard specification that defines how networking is configured for Linux containers.

Rather than implementing networking itself, Kubernetes relies on a CNI plugin to provide network connectivity for pods.


Why Use CNI?

A CNI plugin is responsible for:

  • Assigning IP addresses
  • Connecting pods to the network
  • Managing routing
  • Enabling communication between containers
  • Integrating with different networking solutions

Because Kubernetes follows the CNI standard, different networking plugins can be used without changing Kubernetes itself.


Example

Think of CNI as a universal power outlet.

Regardless of which appliance (network plugin) you use, it plugs into the same standard interface and functions correctly.


What Is Cilium CNI?

Definition

Cilium CNI is the Kubernetes networking plugin that implements the CNI specification using Cilium.

It combines Kubernetes networking with the performance and security advantages of eBPF.


Benefits of Cilium CNI

Compared to traditional networking plugins, Cilium CNI offers:

  • Faster networking
  • Reduced latency
  • Kubernetes-aware security policies
  • Advanced traffic routing
  • Deep network visibility
  • Scalable networking for large Kubernetes clusters

Example

Continuing the office analogy, Cilium CNI functions like an intelligent security system that not only connects every office but also controls who can communicate, monitors activity, and blocks unauthorized access automatically.


What Is Kind?

Definition

Kind (Kubernetes in Docker) is a tool for running local Kubernetes clusters using Docker containers as cluster nodes.

Each Kubernetes node is represented by a Docker container, allowing developers to create lightweight clusters on their local machines.


Why Use Kind?

Kind is commonly used for:

  • Local Kubernetes development
  • Learning Kubernetes
  • Testing manifests
  • CI/CD pipelines
  • Multi-node Kubernetes experimentation
  • Trying different CNI plugins

Because Kind runs entirely inside Docker, clusters can be created and destroyed quickly without requiring virtual machines or cloud infrastructure.


Example

Imagine building a miniature version of a production data center on your laptop.

Kind lets you experiment with Kubernetes configurations, networking, and deployments locally before moving to a production environment.


With these foundational concepts in place, you're ready to create a two-node Kind cluster, disable the default CNI configuration, and install Cilium to provide networking for the Kubernetes cluster.

What Is Helm?

Definition

Helm is the package manager for Kubernetes. It simplifies the deployment and management of Kubernetes applications by packaging Kubernetes resources into reusable templates called Helm Charts.

Helm enables developers and platform engineers to install, upgrade, configure, and roll back applications using simple commands.


Why Use Helm?

Helm provides several advantages, including:

  • Simplified application deployment
  • Reusable Kubernetes manifests
  • Configuration through values files
  • Version-controlled application releases
  • Easy upgrades and rollbacks
  • Faster management of complex Kubernetes applications

Helm significantly reduces the complexity of managing large Kubernetes deployments.


Example

Think of Helm as an application store for Kubernetes.

Instead of manually creating dozens of Kubernetes resources, you install an application using a single Helm chart that automatically deploys and configures everything required.


What Is Docker?

Definition

Docker is an open-source containerization platform used to build, package, and run applications inside lightweight, portable containers.

A Docker container includes the application, runtime, libraries, dependencies, and configuration required to run consistently across different environments.


Why Use Docker?

Docker provides several key benefits:

  • Application portability
  • Environment consistency
  • Lightweight virtualization
  • Faster deployments
  • Improved resource utilization
  • Isolation between applications

Docker ensures that an application behaves the same way in development, testing, and production environments.


Example

A Docker container is similar to a shipping container.

Regardless of where the container is transported, everything inside remains intact and operates consistently.


What Is Kubernetes?

Definition

Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, networking, and management of containerized applications.

Originally developed by Google, Kubernetes has become the industry standard for running cloud-native applications.


Why Use Kubernetes?

Kubernetes provides:

  • Automated application deployment
  • Self-healing workloads
  • Automatic scaling
  • Load balancing
  • Service discovery
  • Rolling updates and rollbacks
  • High availability

These features allow organizations to efficiently manage containerized applications at scale.


Example

Imagine a large office building with hundreds of employees.

Kubernetes acts as the building manager, ensuring every department has the resources it needs, replacing unavailable staff automatically, balancing workloads, and keeping the entire organization running smoothly.


Prerequisites

Before creating the Kind cluster and installing Cilium, install the required tools on your machine or Amazon EC2 instance.

You'll need:

  • Docker
  • Kind
  • kubectl

Important: Include only one screenshot showing the successful installation verification (Docker, Kind, and kubectl versions in the terminal). Individual installation screenshots are unnecessary because the commands below are sufficient.


Install Docker

Update the package repository.

sudo apt update  

Install Docker.

sudo apt install -y docker.io  

Start the Docker service.

sudo systemctl start docker  

Enable Docker to start automatically during system boot.

sudo systemctl enable docker  

Add the current user to the Docker group.

sudo usermod -aG docker ubuntu  

Install Kind

Download the Kind binary.

curl -Lo ./kind \  
https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64  

Make the binary executable.

chmod +x ./kind  

Move the executable into the system path.

sudo mv ./kind /usr/local/bin/kind  

Verify the installation.

kind version  

Install kubectl

Download the latest stable kubectl release.

curl -LO \  
"https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"  

Download the checksum.

curl -LO \  
"https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"  

Verify the download.

echo "$(cat kubectl.sha256) kubectl" | sha256sum --check  

Install kubectl.

sudo install \  
-o root \  
-g root \  
-m 0755 \  
kubectl \  
/usr/local/bin/kubectl  

Make the binary executable.

chmod +x kubectl  

(Optional) Move the binary to the local user path.

mkdir -p ~/.local/bin

mv ./kubectl ~/.local/bin/kubectl  

Verify the installation.

kubectl version --client  

With Docker, Kind, and kubectl successfully installed, your environment is now ready to create a two-node Kind Kubernetes cluster and install the Cilium CNI plugin.

Step 1: Create a Multi-Node Kubernetes Cluster with Kind

The first step is to create a local Kubernetes cluster using Kind (Kubernetes in Docker). We'll configure the cluster with one control plane node and two worker nodes, providing a lightweight environment for testing the Cilium CNI plugin.

Important: Include only one screenshot showing the successful Kind cluster creation or the output of kubectl cluster-info. The configuration file below is sufficient, so intermediate terminal screenshots are unnecessary.


1.1 Create the Kind Configuration File

Create a file named kind-config.yaml with the following configuration:

kind: Cluster

apiVersion: kind.x-k8s.io/v1alpha4

nodes:  
  - role: control-plane  
  - role: worker  
  - role: worker  

This configuration creates:

  • 1 Control Plane node
  • 2 Worker nodes

The control plane manages the Kubernetes cluster, while the worker nodes run application workloads.


1.2 Create the Cluster

Run the following command:

kind create cluster --config kind-config.yaml  

Kind uses Docker containers to provision and configure the Kubernetes cluster according to the configuration file.


1.3 Verify the Cluster

After the cluster is created successfully, verify its status.

Display cluster information:

kubectl cluster-info  

Verify all nodes are available:

kubectl get nodes  

The output should show:

  • One Control Plane node
  • Two Worker nodes
  • All nodes in the Ready state

At this point, your local multi-node Kubernetes cluster is ready for Cilium installation.


Step 2: Disable the Default CNI Configuration

Kind installs a default networking configuration when the cluster is created. Since this guide uses Cilium as the networking solution, the default configuration should be removed before installing Cilium.


2.1 Remove kube-proxy

Delete the default kube-proxy DaemonSet:

kubectl delete daemonset kube-proxy \  
-n kube-system  

Removing kube-proxy allows Cilium to provide its own networking and service load-balancing capabilities.


2.2 Remove Existing CNI Configuration

Delete any existing CNI configuration files:

sudo rm -rf /etc/cni/net.d/*  

This ensures there are no conflicting CNI configurations before installing Cilium.


Verify the Environment

After completing the above steps:

  • The Kind cluster should still be running.
  • kube-proxy should be removed.
  • Existing CNI configuration files should be deleted.
  • The cluster is now ready for installing the Cilium CNI plugin.

Step 3: Install the Cilium CNI Plugin

With the Kind cluster ready and the default networking components removed, the next step is to install Cilium as the Container Network Interface (CNI) plugin.

Cilium provides high-performance networking, Kubernetes-native security policies, service load balancing, and deep network observability using eBPF.

Important: Include only one screenshot showing the successful Cilium installation (for example, the Cilium pods running in the kube-system namespace). Installation command screenshots are unnecessary since the commands are provided below.


3.1 Install Helm

Helm is the package manager for Kubernetes and is used to install Cilium.

If Helm is not already installed, run:

curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash  

Verify the installation:

helm version  

3.2 Add the Cilium Helm Repository

Add the official Cilium Helm repository:

helm repo add cilium https://helm.cilium.io/  

Update the local Helm repository index:

helm repo update  

3.3 Install Cilium

Install Cilium into the kube-system namespace:

helm install cilium \  
cilium/cilium \  
--version 1.11.0 \  
--namespace kube-system  

This command deploys the Cilium components and configures the cluster to use Cilium as its networking solution.


3.4 Verify the Installation

Check whether the Cilium pods are running successfully:

kubectl get pods \  
-n kube-system \  
-l k8s-app=cilium  

You should see one Cilium pod running on each Kubernetes node, with all pods reporting a Running status.

You can also verify the overall cluster status:

kubectl get pods -n kube-system  

At this stage, the Kubernetes cluster is fully configured to use Cilium for networking.


Frequently Asked Questions

What are Kubernetes Network Policies?

Network Policies define how pods are allowed to communicate with each other and with external resources.

They help enforce security by allowing or denying network traffic based on labels, namespaces, ports, and protocols.


How can I verify that Cilium is working correctly?

You can verify the installation by:

  • Checking that all Cilium pods are in the Running state.
  • Confirming there are no errors in the pod logs.
  • Deploying sample applications and testing pod-to-pod communication.
  • Applying Kubernetes Network Policies and validating traffic behavior.

Can Cilium be used together with another CNI plugin?

No.

Cilium is designed to function as the primary networking solution for a Kubernetes cluster and should not be used alongside another CNI plugin within the same cluster.


Conclusion

In this guide, you created a multi-node Kubernetes cluster using Kind, removed the default networking components, and successfully installed the Cilium CNI plugin using Helm.

With Cilium in place, the cluster now benefits from modern Kubernetes networking powered by eBPF, enabling high-performance networking, advanced security policies, and enhanced observability.

This environment provides an excellent foundation for exploring Kubernetes networking, CNI plugins, service connectivity, network policies, and cloud-native security in future hands-on tutorials.

Hi! I'm ERICA. Ask me anything!