The Simplest Way to Make Longhorn and Metabase Work Like They Should
Running longhorn and metabase together lets teams store analytics state and query data on Kubernetes. Longhorn manages persistent block volumes, while Metabase reads databases and saves dashboard state. This setup keeps analytics workloads inside your cluster without external disk dependencies. Teams can back up dashboard settings and query business stores from one place. How longhorn and metabase handle storage and data flow Metabase needs two distinct data paths to run well in production.
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.
Running longhorn and metabase together lets teams store analytics state and query data on Kubernetes. Longhorn manages persistent block volumes, while Metabase reads databases and saves dashboard state.
This setup keeps analytics workloads inside your cluster without external disk dependencies. Teams can back up dashboard settings and query business stores from one place.
How longhorn and metabase handle storage and data flow
Metabase needs two distinct data paths to run well in production. First, it needs an internal database to save users, questions, and dashboard layouts. Second, it needs network routes to read your business databases for charts. Longhorn fits into the first path by giving Kubernetes pods persistent block storage.
When you run a state database like PostgreSQL on Kubernetes, Longhorn holds the disk files. Longhorn copies volume blocks across cluster nodes so node failures do not lose charts. Metabase logs into that state database with a user role and password. It writes new questions and reads saved views on every page load.
At the same time, Metabase opens read sessions to your target analytics stores. Analysts build charts in the browser, and the app sends queries to the database. The storage engine keeps the underlying volume blocks safe on disk. Meanwhile, the database role controls which tables the analytics app can read.
Teams also use Longhorn snapshots to back up the state volume before app upgrades. If a new Metabase version fails during startup, you can restore the volume fast. This flow separates disk safety from query permissions inside your cluster.
Common failure modes and how to scope roles
Many teams rush the setup and use one broad database role for everything. They give the analytics app the same admin key used for schema migrations. If a user runs a bad query, it can lock tables or expose secrets. Shared service accounts also make database audit logs hard to read.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
When every chart runs under one shared user, logs only show the app name. You cannot tell which team member ran a heavy query on sensitive tables. Another common risk comes from storing raw emails or card numbers in open tables. Without field controls, any chart builder can pull phone numbers or national IDs.
To fix this, split your database roles by job and scope network paths. Create one dedicated role for the Metabase internal state database with write access there. Create a separate read-only role for your business data tables. Never let the chart reader role write data or change table schemas.
Next, lock down Kubernetes network rules between the analytics pod and storage nodes. Only allow the state database pod to mount the Longhorn volume. Set up network policies so Metabase can only talk to approved database ports. Use data masking to rewrite emails and card numbers in query results.
Keeping backups and query access clean in production
Longhorn volumes need regular health checks to prevent full disks from crashing databases. Set up alerts on volume space so state writes never stop mid-query. Schedule snapshots during quiet hours to avoid disk slowdowns while analysts build reports. Test your volume restore process in a staging cluster every few months.
On the query side, review which tables your read-only role can reach each quarter. Remove permissions for old tables or raw staging schemas that analysts do not need. Keep internal app state on its own volume, away from production customer records. Clear separation keeps both your block storage and your chart queries fast and safe.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Does Metabase connect directly to Longhorn volumes?
No, Metabase talks to a relational database like PostgreSQL over the network. Longhorn provides the block storage volume that holds files for that database pod.
What happens to saved dashboards if a Kubernetes node fails?
Longhorn keeps copies of your volume blocks across multiple nodes in the cluster. Kubernetes moves the database pod to a healthy node and reattaches the volume.
How should we restrict sensitive fields in analytics queries?
Give the analytics app a read-only database role scoped to safe views. Use dynamic data masking to rewrite emails, phone numbers, and card numbers in results.
Related guides
In this post