- https://medium.com/@abdulfayis/storage-orchestration-for-kubernetes-c6370f943e23
- Type: tutorial
- Source: Medium · Abdul Fayis · Feb 2024
TL;DR
Two ways to give Kubernetes persistent storage: Rook-Ceph (block, shared filesystem and S3-style object storage) and Longhorn (simple replicated block volumes with a UI), each shown with install steps and a sample workload.
Summary
Rook is an operator that deploys and manages Ceph on Kubernetes; Ceph provides object, block and file storage with replication and self-healing. Longhorn is a cloud-native distributed block storage system with snapshots, backups and cross-cluster disaster recovery. The tutorial installs the Rook operator and a Ceph cluster, checks health from the toolbox pod, and provisions block storage for WordPress and MySQL, a CephFS shared filesystem for a kube-registry, and an S3 bucket through an ObjectBucketClaim. It then installs Longhorn and persists a MySQL database across a pod deletion.
Key takeaways
- Rook-Ceph needs raw storage: raw devices or partitions, LVM volumes, encrypted or multipath devices, or block-mode PVs on the nodes.
- Install order:
crds.yaml,common.yaml,operator.yaml, thencluster.yaml; verify withkubectl -n rook-ceph get podandceph statusfrom the toolbox. - Block storage: create a
CephBlockPooland aStorageClass(rook-ceph-block), then reference it from PVCs (ReadWriteOnce). - Shared filesystem:
CephFilesystemplus arook-cephfsStorageClass givesReadWriteManyvolumes for multiple pods. - Object storage: a
CephObjectStorestarts the RGW service; anObjectBucketClaimcreates buckets, consumed with S3 clients through a user’s access keys. - Longhorn prerequisites: Kubernetes 1.14+, Helm,
open-iscsion every node. - Longhorn install:
kubectl applyof the release YAML or Helm intolonghorn-system, then the UI viakubectl port-forwardon thelonghorn-frontendservice. - Persistence test: create a MySQL database, delete the pod and confirm the data survives.
Tools and concepts
| Item | Role in the page |
|---|---|
| Kubernetes | StorageClass, PVC and PV resources |
| Rook, Ceph | Operator and distributed storage system |
| Longhorn | Replicated block storage with a dashboard |
| Helm | Longhorn installation method |
| S3 | The API exposed by Ceph object storage |
| Linux | Node prerequisites (open-iscsi) |
When to use
- When choosing storage for stateful workloads on Kubernetes (block, file or object).
- When you need the Rook-Ceph install sequence and sample manifests.
- When you want a lighter alternative such as Longhorn for replicated volumes.
Caveats
- Hands-on notes: the sample secrets and keys printed in the article are demo values, and production sizing, upgrades and failure testing are not covered.
- Examples use MySQL 5.6 images and old API snippets; check current Rook and Longhorn docs.
Kubernetes Helm S3 Linux Kubetools - A Curated List of Kubernetes Tools Starting containers in order on Kubernetes with InitContainers