Feedback

Chat Icon

End-to-End Kubernetes with Rancher, RKE2, K3s, Fleet, Longhorn, and NeuVector

The full journey from nothing to production

Longhorn: Understanding How It Works with Practical Examples
60%

Core Components: Longhorn Manager and Engine

When a Persistent Volume Claim (PVC) is created in the Kubernetes cluster, Longhorn, running in the longhorn-system namespace, automatically provisions a corresponding volume. To view the status of the volume, follow these steps:

# SSH into the RKE2 CP
ssh root@$WORKLOAD_CONTROLPLANE_01_PUBLIC_IP

# List the Persistent Volumes
kubectl -n longhorn-system get volumes.longhorn.io

At a high level, to create and attach the volume to a pod, Longhorn typically follows these steps:

Volume Creation: Longhorn, using the Longhorn Manager, creates a volume and schedules the replicas across the nodes in the cluster.

Volume Attachment: The Longhorn Engine microservice, the world's smallest storage controller according to its documentation, connects to the replicas of the volume. The Engine is scheduled on the same node as the pod consuming the volume.

Frontend Exposure: The Engine exposes the block device on the node. The pod then mounts this block device to access the volume.

This is ensured by the Longhorn Manager. The Longhorn Manager operates as a critical DaemonSet (longhorn-manager) deployed across all nodes in the cluster. It ensures that volumes are created, managed, and attached in alignment with Kubernetes standards. Each longhorn-manager pod is labeled with app=longhorn-manager and is responsible for watching the Kubernetes API server for custom resource updates, such as the creation of a Longhorn volume.

End-to-End Kubernetes with Rancher, RKE2, K3s, Fleet, Longhorn, and NeuVector

The full journey from nothing to production

Enroll now to unlock all content and receive all future updates for free.