Roll out Kubernetes component upgrades in stages with a scheduled agent

Benchling runs Cursor Cloud Agents on a schedule to upgrade 30+ Kubernetes components through dev, staging and prod by opening Terraform PRs. Hundreds merged since April, about five times the old pace.

What they did

Brendan Neutra, an engineer on Benchling's production infrastructure team, describes how the company keeps more than thirty cluster components current: Helm charts such as Karpenter and Argo CD, node machine images, and container images like the Datadog agent. Versions live in checked-in constants files keyed by stage, so an upgrade is a one-line change per stage. A Cursor Cloud Agent automation wakes on a schedule and reads a rollout config for each component. The config says where releases are published, how long a release must age before it is picked, what to check in the release notes, which dependencies to verify, how to test health in a dev cluster with commands or Datadog metrics, and how many days each stage must bake. The agent works out where each component stands from the constants files and the git log, then either does nothing or opens the next PR. It can run Terraform plans and open PRs in GitHub, with AWS and Datadog access limited by policy, but cannot change production on its own. A human approves every PR. The agent also writes an expected Terraform plan pattern into the PR so an internal service can apply matching runs after merge.

How it went

The setup has run since April. In that time the agents opened and merged hundreds of rollout PRs across more than thirty components, roughly five times the team's earlier cadence, and the team stopped skipping releases. In one case the agent read release notes for a network controller update, found that Benchling relied on a default the new version changed, kept the old value in the same PR, explained why, and confirmed in a dev cluster that network settings held. Most scheduled runs end with no change. When dev verification fails, no PR is opened and the owning team is told in Slack.

Worth knowing

This is the company's own engineering blog, not an outside review. It only works because the infrastructure was already declarative Terraform with staged environments and required PR review; the staged rollout is the safety net if the agent misses a breaking change. The agent is stateless and holds no production credentials. The post does not give cost or failure counts.

Try it

With Cursor· 11 parts to fill in

You maintain version upgrades for [component name] in [repo]. Read the rollout config at [path to config]. Check [release URL] for the newest stable release that has been out at least [number] days. Work out which version each stage ([dev, staging, prod]) is on from [constants file] and when the last stage merged from git log. If the previous stage has not baked for [number] days, stop and do nothing. Otherwise read the release notes for breaking changes, deprecated settings and changed defaults, and check our configuration for anything they affect. Make the one-line version bump for the next stage, plus any config fix needed to keep current behaviour. For dev, apply it to [dev cluster] and verify health with [commands or metrics]; if that fails, open no PR and post the failure to [team channel]. Otherwise open a PR with a short write-up of what changed and what you checked, then stop and wait for a human to review and merge.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related