The Simplest Way to Make Kuma and Pulumi Work Like They Should
Teams pair kuma and pulumi to write and run service mesh rules in code. Pulumi sets up the Kuma control plane and sends traffic rules to each app. This pairing lets engineers manage network rules in the same repo as their apps. You do not need to click through dashboards or copy files by hand. Every change goes through code review before it hits your live mesh. How kuma and pulumi share keys and rules Pulumi talks to your cluster API or the Kuma control plane API. It reads your code and turn
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.
Teams pair kuma and pulumi to write and run service mesh rules in code. Pulumi sets up the Kuma control plane and sends traffic rules to each app.
This pairing lets engineers manage network rules in the same repo as their apps. You do not need to click through dashboards or copy files by hand. Every change goes through code review before it hits your live mesh.
How kuma and pulumi share keys and rules
Pulumi talks to your cluster API or the Kuma control plane API. It reads your code and turns it into mesh rules for your apps. Then Kuma reads those rules and sends them to each data plane sidecar.
To make this work, Pulumi needs a key with write access to the mesh. Most teams store this key in their build system or secret store. When a build runs, Pulumi logs in and updates the mesh state.
Kuma then checks the new rules and pushes them to all running services. It sets up mutual TLS, traffic splits, and retry rules between your apps. Pulumi keeps a record of what it built in its own state file.
This flow keeps your code and your live mesh in sync at all times. If someone changes a rule by hand, the next Pulumi run fixes it. Your git history becomes the single record of what should run in production.
Common failure modes and how to scope roles
Many teams give Pulumi a single admin key with full cluster rights. If that key leaks, an attacker can change every app and mesh rule. A bad script could also wipe out routing rules across all teams at once.
Shared service accounts also make it hard to see who made a change. Your logs will only show the shared bot account, not the real engineer. When a bad rule breaks traffic, teams waste hours hunting for the cause.
Pulumi Policy as Code + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Unlogged changes outside of code create another big risk for your mesh. Engineers often log into the cluster during an outage to fix a rule fast. Later, Pulumi runs again and overwrites that manual fix without warning.
To fix this, give each team its own Pulumi project and scoped role. Each role should only write rules for one Kuma mesh or one namespace. Never let an app team edit the global control plane settings.
You should also lock down network paths to the Kuma control plane API. Only your build runners and approved admin networks should reach that API port. Block direct edits from engineer laptops so all changes flow through code review.
Keeping state and secrets safe across teams
Pulumi state files often hold plain text values from your mesh setup. If you pass certs or keys through Pulumi, they end up in state. Always encrypt your state backend and restrict who can read those files.
Rotate the keys that Pulumi uses to talk to Kuma on a set schedule. Short key lifetimes limit the damage if a build runner gets breached. Check your API logs often to spot odd traffic or failed login tries.
Run a preview check on every pull request before you merge any code. This step shows the exact Kuma rules that Pulumi will add, change, or drop. Peer review catches bad traffic rules before they break live services.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
How does Pulumi apply changes to a Kuma mesh?
Pulumi reads your code and sends updates to the cluster or Kuma API. The Kuma control plane then pushes the new rules to the sidecars.
Should one Pulumi stack manage both the control plane and mesh rules?
No, split them into separate stacks with different roles and keys. Let the platform team run the control plane while app teams manage their own rules.
How do we stop manual edits from breaking Pulumi state?
Give engineers read-only roles on the mesh and run all writes through Pulumi. Run scheduled drift checks to spot any changes made outside of code.
Related guides
In this post