How to Configure MicroK8s Read Only Access
You set up microk8s read only access by turning on role rules and binding a viewer role. Then you share a scoped token so users can check cluster state without changing it. Many teams start by sharing the default admin file with every developer on the team. That broad key lets anyone delete pods, edit live services, or read stored secrets by mistake. A strict viewer setup stops accidental changes before they break running apps. How microk8s read only access works in your cluster MicroK8s uses
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 microk8s read only access by turning on role rules and binding a viewer role. Then you share a scoped token so users can check cluster state without changing it. Many teams start by sharing the default admin file with every developer on the team. That broad key lets anyone delete pods, edit live services, or read stored secrets by mistake. A strict viewer setup stops accidental changes before they break running apps.
How microk8s read only access works in your cluster
MicroK8s uses standard Kubernetes role rules to control what each user or tool can do. When you first install the cluster, the role add-on stays off by default. You must enable the role add-on first so the API server checks every request. Once active, the cluster denies all requests unless a matching rule gives permission.
Next, you create a service account or user identity for your team members. You then link that identity to a built-in view role using a role binding. A standard binding grants read rights inside one namespace for one specific team. A cluster-wide binding grants read rights across every namespace in the whole node.
The built-in view role lets users list pods, check deployment status, and read container logs. It blocks write calls, so nobody can create, update, or delete any running resource. It also hides secret objects by default to keep API keys and passwords safe. Finally, you export a client file with the new viewer token for your engineers.
What native roles solve and what gaps remain
Native role bindings solve the basic problem of shared admin keys across a team. Engineers can inspect failing pods and read event logs without risking a cluster outage. Automated tools can also watch node health using a safe, restricted identity. This setup works well for small teams with simple rules and low turnover.
Still, static viewer files still leave big operational gaps for growing engineering teams. Once you hand out a client token, that token lives on a developer laptop. If a laptop gets lost, you must rotate keys and hand out new files. Native role bindings also decide who logs in, not what happens inside the response.
Auditor Read-Only Access + Customer Support Access to Production: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
For example, a viewer can still read sensitive data printed inside standard container logs. App logs often print customer emails, phone numbers, card numbers, or national IDs during errors. Native Kubernetes roles cannot rewrite those fields in results before they reach the screen. Standard roles also lack a simple way to approve temporary write rights for quick fixes. Teams end up keeping separate admin keys around, which brings back the original risk.
Managing cluster permissions across growing teams
As your team adds more nodes, managing local tokens on each machine takes too much time. Every new cluster needs the same role add-on, service accounts, and bindings set up by hand. When an engineer leaves the company, admins must scrub their token from every single node.
Tying cluster roles to a central identity provider helps reduce this manual token work. You can map team groups to viewer roles instead of making local service accounts. Even then, you still need clear audit logs showing every query run against the API. You also need controls that filter sensitive fields out of log streams in flight.
Check Kubernetes API requests and responses on the wire
Kubernetes RBAC decides who may call the API server. RBAC does not check response payloads or split listing Secret names from reading Secret values when a role grants get access. With hoop.dev, you run an open-source proxy, a sidecar for your Kubernetes API, inline on the API connection. On every kubectl or API call an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.
On each call, hoop.dev guardrails read the method, normalized path, and headers to refuse bad deletes or full Secret reads with a 403 error, or hold risky calls for approval. On the way back, hoop.dev data masking walks JSON responses by key and masks matched values in Secrets, ConfigMaps, and pod logs in memory. View the project on GitHub.
Frequently asked questions
Does the built-in view role allow users to read Kubernetes secrets?
No, the built-in Kubernetes view role blocks secret objects by default for safety. This rule stops read-only users from pulling database passwords or API keys from the cluster. Users can still view config maps, pod specs, and normal container logs.
How do I limit a viewer to a single namespace in MicroK8s?
You use a namespace role binding instead of a cluster-wide role binding. You attach the built-in view role to your user inside that one target namespace. The user will only see pods, services, and logs running inside that space.
Can read-only users still see sensitive data inside pod logs?
Yes, anyone with log read rights can see whatever text the app prints out. If an app logs emails, phone numbers, or card numbers, the viewer sees them. You need data masking in flight to rewrite those matched fields in results.
Related guides
In this post