Kubernetes Prometheus Helm
You deploy a kubernetes prometheus helm stack by adding the chart repo and installing the release. You must also set up role rules so the metric pods can read cluster targets. Most teams start this setup by granting wide cluster permissions to get metrics flowing fast. When roles are too broad, users and service accounts can read sensitive objects across all namespaces. This creates a major security risk if a pod or user key gets stolen. How a kubernetes prometheus helm setup works A chart pa
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 deploy a kubernetes prometheus helm stack by adding the chart repo and installing the release. You must also set up role rules so the metric pods can read cluster targets. Most teams start this setup by granting wide cluster permissions to get metrics flowing fast. When roles are too broad, users and service accounts can read sensitive objects across all namespaces. This creates a major security risk if a pod or user key gets stolen.
How a kubernetes prometheus helm setup works
A chart packages all the manifests needed to run your metric collection pods and alerts. When you install the chart, it creates service accounts and permission rules in your cluster. Kubernetes RBAC uses the authorization API group on the API server to check every request. In this system, permissions are purely additive, which means there are no deny rules. A standard Role sets permissions inside one single namespace for local resources. A ClusterRole is not namespaced and covers cluster-wide objects like nodes or non-resource endpoints. It can also grant rights to namespaced objects across every namespace in the cluster. To give these rights to your metric service account, the chart creates bindings. A RoleBinding grants rights inside one namespace by linking to a Role or ClusterRole. A ClusterRoleBinding grants access across the entire cluster at once. Metric collectors need a ClusterRoleBinding to scrape node stats and pod data everywhere. Admins also need role bindings to run chart updates and check the deployed pods.
How to scope chart roles for your team
Before you run the chart install, you should plan who can manage the monitoring namespace. Give your operators a RoleBinding that only applies to the namespace where metrics live. Avoid giving humans a ClusterRoleBinding unless they manage the whole cluster every day. You can also control who can view pod logs or open a shell inside containers. In Kubernetes RBAC, features like pod logs and pod exec are called subresources. RBAC rules write these subresources with a slash in the resource name. If an engineer only needs to read logs, grant them the log subresource only. Do not include the exec subresource in their standard daily role. This simple split stops users from running commands inside the metric collector containers. Review the service accounts created by the chart to make sure each part has minimal rights.
What native RBAC solves and what it leaves open
Native Kubernetes RBAC does a great job deciding who can talk to the API server. It checks if a user or pod can read a resource or open a shell. Still, this setup only checks permissions at the moment the request starts. Once an engineer gets exec rights to fix a broken metric pod, RBAC steps back. It cannot see or control the individual shell commands that the engineer runs inside. If a role allows reading secrets or config data, raw values return in full. Native roles cannot rewrite sensitive fields like emails, phone numbers, or card numbers in flight. Teams also struggle when they share static cluster keys to run chart upgrades from laptops. Long-lived keys sit on disk and give permanent rights until someone rotates them by hand. To stay safe, teams need a way to inspect commands and remove static keys.
Kubernetes RBAC + Helm Chart Security: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
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
Why does a metric chart need a ClusterRole instead of a Role?
Metric collectors must read node health and pod stats across every namespace in your cluster. A ClusterRole with a ClusterRoleBinding allows the collector to read these cluster-wide targets.
Can I add a deny rule in Kubernetes RBAC to block secret access?
No, Kubernetes RBAC permissions are purely additive and do not support deny rules. To block access, you must remove the permission rule from the Role or ClusterRole.
How do I let engineers read metric pod logs without shell access?
Create a Role that grants read rights to the pods log subresource only. Leave the pods exec subresource out of the rule so users cannot open a shell.
Related guides
In this post