K3s Storage Options

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up k3s storage options by picking a driver for your data needs. Built-in local paths handle single nodes, while CSI drivers add shared network disks. Teams often start with the default local path tool for quick test setups. When apps need high uptime, admins add shared block systems or network file shares. Still, setting up storage often leads teams to grant broad cluster admin roles. When engineers hold full storage permissions, a single bad command can wipe production disks. How k3s

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You set up k3s storage options by picking a driver for your data needs. Built-in local paths handle single nodes, while CSI drivers add shared network disks. Teams often start with the default local path tool for quick test setups. When apps need high uptime, admins add shared block systems or network file shares. Still, setting up storage often leads teams to grant broad cluster admin roles. When engineers hold full storage permissions, a single bad command can wipe production disks.

How k3s storage options work in practice

K3s ships with a built-in local path tool right out of the box. This tool writes pod data straight to a folder on the host node. It works well for single nodes or edge boxes that do not share disks. When a pod moves to a new node, it cannot read that old folder.

Multi-node clusters need shared storage so pods can move across hosts freely. Teams add Container Storage Interface drivers to link K3s with external disk arrays. Many teams run Longhorn to replicate block storage across the local node disks. Others mount existing network file shares or cloud block volumes into the cluster. The storage class rule tells the cluster how to create and delete volumes. Admins also pick a reclaim rule to keep or wipe data after pod removal.

How cluster datastores differ from workload volumes

When reviewing k3s storage options, teams must separate app volumes from cluster state. Workload volumes hold the files, logs, and databases for your running apps. The cluster datastore holds the K3s state, node list, and secret keys.

By default, K3s stores its own cluster state inside a local SQLite file. To run multiple server nodes, admins switch this state layer to embedded etcd. You can also point the cluster state at an external SQL database. Keeping cluster state safe requires strict role rules on the server nodes.

Storage Options: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native storage roles solve and what they miss

Kubernetes role-based rules let you limit who can create or delete volume claims. You can put storage classes in separate namespaces and restrict role bindings. This setup controls who can log in and ask the API for disks.

Still, native role checks stop once a user gets exec or admin rights. An engineer debugging a broken mount often gets broad pod or node permissions. Once inside a pod, native roles do not check individual shell commands in flight. A mistyped cleanup script can delete shared files across every mounted pod. Also, a user inspecting a database volume might read raw customer emails or card numbers. Standard role bindings decide who enters the cluster, not what their live commands do.

Govern kubectl and API calls in flight

Identity providers and Kubernetes RBAC decide who logs into a cluster. They cannot redact keys inside returned JSON objects or hold a risky delete call for review. By design, hoop.dev runs as an open-source proxy, a sidecar for your Kubernetes API, checking requests and responses without replacing RBAC.

First, hoop.dev guardrails refuse banned methods, paths, or headers before they run. Next, hoop.dev data masking rewrites sensitive keys in returned Secret, ConfigMap, and log responses in memory, and writes each decision to the audit trail. Explore the repo on GitHub.

Frequently asked questions

What is the default storage driver in K3s?

K3s includes the Local Path Provisioner by default on every new install. It creates host path volumes on the specific node where the pod runs. This setup needs no extra tools, making it great for single-node edge clusters.

Can K3s run shared storage across multiple nodes?

Yes, K3s supports any standard Container Storage Interface driver for shared disks. Teams often install Longhorn, Ceph, or NFS drivers for multi-node volume access. Cloud users can also install the matching block storage driver for their provider.

How do we protect sensitive data stored on K3s volumes?

Start by turning on disk encryption on the underlying host or storage array. Next, limit who can exec into pods that mount those production volumes. Finally, add command checks and data masking for live sessions that inspect stored data.

The query runs. The emails stay hidden.