New Signadot is now available on AWS Marketplace. Buy it through your AWS account.

Ephemeral Environments: The Complete Kubernetes Guide

What ephemeral environments are, the four ways to build them on Kubernetes, the tools compared, and how they handle cost, databases, message queues and the volume coding agents bring.

Published
February 28, 2026
Updated
October 10, 2026
Reading time
37 min

Ephemeral environments are temporary, isolated environments created on demand for one code change, pull request or test run, and deleted when that work is done. Each one gives the change its own place to run against the real services it depends on, so developers, CI jobs and coding agents can test in parallel instead of taking turns in one shared staging environment. There are two ways to build them, at opposite ends of one spectrum: duplicate the whole environment for every change, or duplicate only what changed and plug it into a shared environment that runs everything else.

The idea took hold as microservices on Kubernetes broke the two older options. One shared staging environment turned into a queue, and a full copy of the system per developer cost too much to keep running. Coding agents have raised the stakes. By mid-2026, one in three pull requests on GitHub involved an agent, and every one of them needed somewhere real to run before a person reviewed it. One staging slot per team, or a full copy of the stack per pull request, cannot absorb that volume. Duplicating only what changed can. The complete guide to software factories explains why that per-change environment is the sensor that keeps an agent-driven delivery loop stable.

What follows covers the definition and its neighbors, ephemeral testing and development environments, how ephemeral environments work on Kubernetes, the four ways to build them, the tools compared, databases, message queues and workflow engines, service meshes, cost, coding agents and rollout. It is one part of the wider practice in the complete guide to microservices testing.

What are ephemeral environments?

An ephemeral environment is a short-lived, isolated deployment of an application, or of the part of it a change touches, that exists only for the lifetime of the work that created it. Three properties define it:

  • Created on demand. A pull request opening, a developer running a command, a CI job starting or an agent beginning a task creates it. Nobody provisions it ahead of time.
  • Bound to one unit of work. It carries one change, or one test run, and nothing else. Nothing about it is patched or kept in sync by hand, so it is always freshly built from the current main branch plus that change.
  • Destroyed automatically. A merge, a close, a delete command or a time to live (TTL) removes it, along with any data it created.

What ephemeral environments are used for

  • Running integration and end-to-end tests on a pull request against the real versions of its dependencies before merge. This is the ephemeral testing environment, the most common form.
  • Giving a developer a place to run the service they are changing against real neighbors while the change is written, the ephemeral development environment.
  • Letting a coding agent run its build, test and fix loop against real dependencies on every attempt, in parallel with every other agent.
  • Handing a reviewer, a product owner or QA a working URL for one change without a turn in a shared environment.

What they are not for

  • Load and performance testing at production scale, which needs sizing an ephemeral environment does not normally carry.
  • Acceptance cycles measured in weeks, where the environment stops being ephemeral in any useful sense and becomes an unmanaged staging copy.
  • Running untrusted code. An ephemeral test environment isolates a change from other changes, not a hostile process from its host.

Other names for ephemeral environments

The same idea goes by several names, each stressing a different property. On-demand environments and dynamic environments stress how they are created. Per-PR environments, pull request environments and branch environments stress the trigger. Short-lived and temporary environments stress the teardown. Ephemeral test environments, ephemeral testing environments and ephemeral development environments name who uses them. Whatever the name, the meaning is the same: an environment whose lifetime is bound to one unit of work.

Ephemeral vs static environments

A static environment, also called a persistent or long-lived environment, is provisioned once and kept running, and every change that needs it takes a turn. Staging, QA, UAT and pre-prod are static environments, and so is the shared dev cluster many teams run. The difference from an ephemeral environment is ownership of time, not size or fidelity. A static environment is shared by changes in sequence, and an ephemeral environment belongs to one change for its whole lifetime and is deleted after.

Staging is the static environment ephemeral environments most often sit in front of. It drifts because nobody owns the manual fixes it accumulates. The two still depend on each other: every ephemeral environment needs a stable, production-like set of services to run against, and in most designs that stable set is what staging becomes. The complete guide to staging environments covers when one shared environment is still the right call.

Ephemeral vs preview environments

Every preview environment is ephemeral, but not every ephemeral environment is a preview. Ephemeral describes the lifecycle: created for one unit of work and deleted after it. Preview describes one use: trying the change through the web or mobile front end, manually, whether a reviewer clicks through or a coding agent explores it ad hoc. An environment a CI job creates, runs automated tests in and deletes with nobody looking is ephemeral but not a preview. Many preview products rebuild only the frontend in front of shared backends, which is fine for a UI review and useless for a backend change, as per-PR preview URLs explains. The complete guide to preview environments compares preview platforms.

Ephemeral environments vs sandboxes

The word sandbox means two things, and only one of them is an ephemeral environment. Signadot’s ephemeral environments, called Sandboxes in its API, are the second kind: each duplicates only what a change needs on a shared cluster, usually the services it touched, and routes that change’s requests and messages to them. A sandbox for running AI-generated code, the kind E2B, Modal and Daytona sell, is a secure runtime for executing untrusted code, sized for one process, and has nothing to do with testing a system of services. The Kubernetes sandbox page separates the two in detail.

Ephemeral deployments, clusters, infrastructure and containers

The word ephemeral attaches to different layers, and the layer matters:

  • Ephemeral deployment. A set of Kubernetes Deployments created for one change and deleted with it. This is what most ephemeral environments on Kubernetes are made of.
  • Ephemeral cluster. A whole Kubernetes cluster created and destroyed per use. Ephemeral clusters suit CI runners and platform teams testing cluster-level changes, but creating a cluster on EKS, GKE or AKS takes longer than anyone will wait per pull request. Kubernetes ephemeral environments on AWS, Google Cloud or Azure normally keep a long-lived cluster and make the workloads on it ephemeral.
  • Ephemeral infrastructure. The broadest term. It covers both of the above and the general practice of treating servers as disposable.
  • Ephemeral container. Unrelated. A Kubernetes ephemeral container is a debugging container attached to a running pod, for inspecting a service rather than building an environment.

Ephemeral testing environments

An ephemeral testing environment is an ephemeral environment that CI creates for one pull request or test run, where integration and end-to-end tests run against the real versions of the services the change depends on, and which is deleted when the run ends. It is the most common kind, and what most teams mean by ephemeral test environments or ephemeral environments for testing.

Four properties make it better for testing than a shared environment:

  • Attribution. One change per environment means a failing test names one change. In a shared staging environment a failure can come from any change deployed that day, and someone has to work out which.
  • Real dependencies, current with main. Tests call the services the change will meet in production, at the versions on main, rather than mocks that drift from how those services behave.
  • Parallel runs. Ten pull requests get ten environments at once, so time to a result does not grow with the queue.
  • A known starting state. Every run starts from the same data and versions, not from what another test left behind.

Any test framework runs inside one. Playwright, Cypress and Selenium drive the UI, Postman and RestAssured exercise APIs, and in-cluster runners such as Testkube or Signadot Jobs run suites next to the services under test. The environment provides the place to run, and the tests decide whether the change is good. CI posts the result and the URL back to the pull request, and a TTL removes the environment if CI does not. Kubernetes test environments covers how this looks with Signadot.

Ephemeral development environments

An ephemeral development environment, or ephemeral dev environment, is one a developer works in while a change is still being written: the service being edited runs on a laptop or in the cluster, connected to real versions of everything it calls, and the environment goes away with the branch. It replaces two older habits, mocking the neighbors and running the whole system locally, both of which stop working past a dozen services.

Two shapes are common:

  • A local process connected to a cluster. The developer runs the service on a laptop with a debugger and hot reload, and requests meant for that service are sent from the cluster to the laptop. Signadot does this with the same ephemeral environment it gives pull requests and coding agents. Local development tools such as mirrord and Telepresence also connect a local process to a cluster, and differ in how they keep one developer’s traffic away from another’s.
  • A remote environment in the cluster. A remote environment in the cluster. The code syncs into a container in the cluster and rebuilds there, so a laptop runs little more than an editor. Okteto works this way, and its Divert mode deploys only the services a developer changes into their namespace and sends everything else to a shared one.

Either way, the ephemeral part is the changed service, its own data where the change writes, and routing that keeps one developer’s requests away from everyone else’s. It lives for the life of a branch rather than a CI run, so a TTL tied to inactivity keeps it from becoming a long-lived copy nobody owns. The guide to local development on Kubernetes compares the options in depth.

How ephemeral environments work on Kubernetes

An ephemeral environment on Kubernetes passes through six steps whichever model builds it. The models in the next section differ in what step two provisions and what step three routes, and those two choices set the cost and spin-up time of everything else.

TriggerPR or agentProvisionworkloadsRoutetag requestsSeedattach dataTestrun testsExpireTTL or merge
Provision and route, in purple, are the two steps the four build models do differently.
TriggerPR or agentProvisionworkloadsRoutetag requestsSeedattach dataTestrun testsExpireTTL or merge
Provision and route, in purple, are the two steps the four build models do differently.
  • Trigger. A pull request opens, a developer runs a CLI command, a CI job starts, or an agent calls an API or an MCP server. The trigger carries the identity of the change: a branch, an image tag and the person or agent behind it.
  • Provision. A controller creates the workloads. In a namespace-per-change model that means applying every manifest of the application into a fresh namespace, usually through a Helm release or an Argo CD ApplicationSet. When each change duplicates only what it needs, it means deploying just those parts, often the one or two services it touched, next to the stable versions of everything else.
  • Route. Full-copy models get a new ingress hostname per environment. When only the changed parts are duplicated, test requests carry a routing header, and each hop sends a tagged request to the changed version when one exists and to the shared stable version when it does not. Messages carry the same key, so asynchronous consumers pick up only their own, and some components need only a configuration change, such as a connection string that points the changed service at its own database.
  • Seed. The environment needs data: a temporary database restored from a fixture, a branch of a database that supports branching, or the shared datastore used read-mostly. Queues need dedicated topics or a way to keep this environment’s messages away from other consumers.
  • Test. CI runs the integration and end-to-end suites, a reviewer clicks through, an agent runs its loop. Logs and traces carry the environment’s identity so a failure points back at the change that caused it.
  • Expire. The pull request merges or closes, the developer deletes the environment, or the TTL fires, and everything provisioned in step two is removed along with the data from step four. An ephemeral environment without an expiry is a staging environment nobody asked for.

Ingress, DNS and URLs for many ephemeral environments

Full-copy models use a wildcard DNS record such as *.preview.example.com pointing at one ingress controller or Gateway API gateway, with a host rule per environment and a wildcard certificate. Models that duplicate only what changed use one hostname for the whole cluster and a routing header that selects the environment, so there is no per-environment DNS or certificate work, but a reviewer’s browser needs a small extension or a preview URL that injects the header. Either way, the CI job that created the environment posts its URL back to the pull request.

The four ways to build ephemeral environments on Kubernetes

The four models differ in how much of the system each change deploys for itself, and they fall along the spectrum in the introduction. Three copy some or all of the system per change: a cluster per environment, a namespace per environment, and a preview build in front of shared backends. The fourth shares one cluster and lets each change duplicate only what it needs, usually the services it touched, while request routing, message routing and configuration connect those copies to everything else. From the most infrastructure per change to the least:

Full environment per PRPR 1PR 2PR 3Namespace per PRns 1ns 2ns 3one clusterPreview environmentUI 1UI 2UI 3shared backendOnly what changedshared serviceschange Achange Bchange Cper change
Purple marks what each change has to deploy for itself.
Full environment per PRPR 1PR 2PR 3Namespace per PRns 1ns 2ns 3one clusterPreview environmentUI 1UI 2UI 3shared backendOnly what changedshared serviceschange Achange Bchange Cper change
Purple marks what each change has to deploy for itself.

A cluster or virtual cluster per environment

Every environment gets its own Kubernetes cluster, or a virtual cluster with its own API server on shared nodes.

  • Strengths. Isolation is complete. Each cluster can run a different Kubernetes version, CRD set or mesh configuration, which makes this the only option for testing cluster-level changes.
  • Costs. Each cluster runs a full copy of every service, a control plane and its own copies of every datastore. A real cluster takes tens of minutes to create. vCluster cuts that to a virtual control plane in under a minute at close to namespace cost, and the vCluster comparison covers where that tier fits.
  • Best fit. Hard tenancy requirements, and platform teams whose changes are to the cluster itself.

A namespace per environment on a shared cluster

The same idea built from primitives you already have: a Kubernetes namespace per environment, with resource quotas, network policies and RBAC for isolation, on one cluster. The tooling is a Helm chart or an ApplicationSet that stamps the application into a fresh namespace when a pull request opens, and it is the model most GitOps pipelines reach for first.

  • Strengths. Cheaper than a cluster per environment, no new infrastructure, and familiar to anyone who runs Kubernetes.
  • Costs. It still deploys every service into every namespace. Data has to be loaded per namespace, startup grows with the application, and each namespace drifts from main between rebuilds. Control-plane load and the security surface grow with the namespace count. Kubernetes namespace vs cluster: pros and cons for test environments weighs both options, and ArgoCD preview environments shows where the ApplicationSet pattern strains.
  • Best fit. Applications under about ten services, on teams fluent in Kubernetes.

A preview build in front of shared backends

For frontend and API-gateway changes, one rebuilt service pointed at shared backends is often enough. It is the cheapest and fastest model, a single build and a URL, and what most hosted preview products deliver by default.

  • Strengths. Seconds to provision, one image to build, nothing to seed.
  • Costs. Only the frontend is isolated. Anything the change writes goes to the shared backends, and a backend change under test has nowhere to run.
  • Best fit. UI review and stakeholder demos.

Only what changed, on a shared cluster

One cluster runs one set of stable service versions, kept current with main. Each change duplicates only what it needs next to those stable versions, usually the services it touched and sometimes its own database or queue, and receives an identity. Test requests carry that identity in a header, and at every hop a tagged request goes to the changed version when one exists and to the shared stable version when it does not. Messages carry it too, so asynchronous consumers process only their own, and some components need only a configuration change to point at the right copy. Each change can duplicate anything from only the services it touched up to the whole stack.

  • Strengths. Hundreds of ephemeral environments for microservices coexist on one cluster, a new one is ready in seconds, and every environment runs against real, current dependencies rather than a copy that drifts. At any real scale on Kubernetes, this is the model that holds up.
  • Costs. The prerequisites are in the application, not the infrastructure. Every service must propagate the routing header on outgoing calls, asynchronous flows need the identity carried in message metadata, destructive changes need their own datastore, and the shared stable versions have to be kept green. The sections on data and service meshes below take those in turn.
  • Best fit. Dozens to hundreds of services, many concurrent changes, and coding agents.

Isolation models for ephemeral environments sets this model against the full-copy ones in detail. Lyft and Razorpay built request routing in-house before it existed as a product, on Envoy sidecars and a Traefik ingress respectively, and how Lyft and Razorpay share development environments with hundreds of devs describes what each took to run.

One option sits below all four: run everything on one machine with Docker Compose, kind or minikube. It is the right answer for a small application, and the guide to lightweight Kubernetes environments covers how far it stretches. Past a dozen services it stops fitting on a laptop, and a single node never behaves like the distributed system it stands in for.

Ephemeral environment tools compared

The best tool for ephemeral environments depends on which end of the spectrum you need. Most platforms copy the whole environment for each pull request, platform teams build the same copy themselves with Argo CD, Helm or vCluster, and a smaller group duplicates only what each change needs and plugs it into a shared environment. The table groups them that way.

Ephemeral environment tools compared, October 2026. Checked against each vendor's own docs and pricing pages on October 9, 2026. Products change quickly, so follow the links for current details.
ToolSpin-up timeCost as environments multiplyDatabases, queues and workflow systemsWorkloads outside KubernetesBest fit
Copy the whole environment per change: platforms
Bunnyshell: a clone of a primary environment per pull request, one namespace eachNot published. Image builds and data seeding set itFull stack per environment. Billed per active environment minute. Stops on a schedule, destroyed on merge or closeDatabase containers seeded from dumps, RDS from snapshots through Terraform, or Neon, PlanetScale and Xata branches. Queues run per environmentTerraform and generic components create cloud resources such as RDSFull-stack PR environments from Compose, Helm or Terraform
Northflank: a preview template per pull request, self-contained or sharing services and a database with devNot published for previews. Builds and database forks set itBilled per second for CPU and memory. Previews take a TTL, pause on a schedule and are deleted when the PR closesPostgreSQL, MySQL, MongoDB, Redis, MinIO and RabbitMQ addons, forked per preview. Kafka and Temporal not stated in its docsOpenTofu nodes and managed S3 and RDS addons create cloud resourcesA general Kubernetes platform with templated previews
Okteto previews: whatever the manifest deploys, usually the full stackNot published. Its docs use 5 to 10 minutes for a full stack as an exampleFull stack per environment. Billed per seat, not per environment. Idle environments sleep, then are deletedA database container per namespace, a database from another repository, or a restored volume snapshotExternal resources: deploy and destroy commands run Terraform or a cloud CLIDevelopment and preview environments on your own cluster
Qovery: a clone of a blueprint environment per pull request, trimmable to fewer servicesAbout 3 minutes from commit to URL, by Qovery's own figureEvery included service, in your cloud account. Plan fee plus deployment minutes. Deleted on merge, close or inactivityDatabases cloned or shared per preview. Blueprints for MSK, RabbitMQ, Redpanda and a Temporal Cloud namespaceTerraform, OpenTofu and CloudFormation through lifecycle jobs, including Lambda functionsA Kubernetes control plane in your own cloud account
Release: every service of the application in one namespace per environmentNot published. An RDS instance alone takes 5 to 6 minutes, which Instant Datasets pre-warmFull stack per environment, in your AWS or GCP account. Enterprise pricing by usage. Environments expire and pause on schedulesDatabase containers, or Instant Datasets: ready RDS, Aurora or Cloud SQL copies from production snapshotsA Terraform runner, and ECS tasks linked by tagFull-stack previews with production-like data in your own cloud
Shipyard: a full-stack environment per pull request from Docker ComposeNot published per environmentSold by environments running at once. Retired after a period with no visitsDatabase containers in each environment, seeded from the base environment's volume snapshotNot stated in its docsDocker Compose applications. Acquired by StackGen in September 2026
Copy the whole environment per change: built in-house
A namespace per pull request with an Argo CD ApplicationSet or HelmPolls for pull requests every 30 minutes by default, or on a webhook, then the full deployFull stack per environment, on your nodes. No license feeWhatever the chart deploys. Seeding and cleanup are yours to buildWhatever your pipeline adds, such as a Terraform stepTeams already on Argo CD with under about ten services
vCluster: a virtual cluster per environment, on shared nodesSeconds to about a minute for the virtual control plane, by vCluster's own figures, plus the deployFull stack plus a control-plane pod per environment. Auto sleep and delete on Enterprise plansWhatever you deploy into itNot stated in its docsA full Kubernetes API per environment, for cluster-level changes
Duplicate only what changed and plug it into a shared environment
Signadot: many ephemeral virtual environments in one shared environment. Each duplicates only what its change needs, joined in by request routing, message routing or configurationSecondsGrows with the services each change duplicates. Usage-based, by environments created. Every environment has a TTLShared database with data kept apart, or temporary databases and Neon or Xata branches through resource plugins. Message routing on one shared Kafka, RabbitMQ, SQS, Pub/Sub or NATS broker. Routing key carried through Temporal workflowsResource plugins create cloud resources per environment, such as managed databases, queues and buckets, with Terraform, Helm, a cloud CLI or a scriptPR environments for dozens to hundreds of services, CI and coding agents
mirrord Preview Environments (Enterprise): only new or changed services, as pods in a shared cluster, scoped by an environment keyNot publishedGrows with the changed services. Enterprise license by concurrent sessions. Each preview has a fixed TTLDatabase branching for many databases. Queue splitting for SQS, Kafka, RabbitMQ, Pub/Sub, NATS, Temporal and others, with the queue name in configurationS3 branches created at the provider. Otherwise not stated in its docsTeams using mirrord for local development who want previews from the same tool
Okteto Divert: only the services you deploy, with the rest from a shared namespace, routed by a baggage headerNot published. Its docs use 10 to 30 seconds to start developing as an exampleGrows with the services you deploy. Billed per seatDatabases and queues shared by default. Queue isolation is your own consumer code filtering on the headerAs for Okteto previewsDeveloper namespaces for large microservice applications

Two kinds of tools sit next to this table rather than in it. Local development tools such as Telepresence and mirrord’s core product connect a process on a laptop or a CI runner to a cluster, the ephemeral development environment case above. Test runners such as Testkube run suites inside a cluster and work with any of these environments, and the microservices testing tools comparison lists them by layer. For one tool at a time, see Okteto alternatives, the Release alternative, Qovery alternatives for preview environments, vCluster alternatives for PR environments, the mirrord alternative and Signadot vs Telepresence.

How ephemeral environments handle databases, message queues and workflow systems

Ephemeral environments handle stateful dependencies in one of three ways: share the stable copy, give the environment its own short-lived copy, or share the resource and keep each environment’s rows, messages or workflows apart. The right one depends on whether the change reads state, writes it additively or changes its shape. This is where most rollouts stall.

Databases

Most changes read from a database or write rows that other tests can ignore, and for those the shared stable database is fine, with each environment’s test data kept apart by a tenant, user or key prefix. A change that alters a schema or writes destructively needs its own copy: a temporary instance or schema seeded from a fixture, or a branch of a database that supports branching, such as Neon or Xata for Postgres, created and dropped with the environment. Full-copy platforms usually run a database container per environment, seeded by a script or restored from a snapshot, which is simple but repeats the data load for every pull request. Testing database schema changes walks through the temporary-instance case and the Neon tutorial the branch-per-environment case, and Signadot’s data isolation guide covers the options.

Message queues: Kafka, SQS, RabbitMQ and others

Queues break shared environments unless you plan for them, because a shared consumer will process a message an isolated producer published. There are two fixes. Give each environment its own topics or queues, which is the least work but cuts the environment off from the traffic the real system carries. Or isolate at the message level: producers put the environment’s routing key in message headers, each environment’s consumers run in their own consumer group and process only messages tagged for them, and the shared consumers skip those. Signadot’s message queue isolation guides cover Kafka, RabbitMQ, SQS and SNS, Pub/Sub and NATS, with a Routes API that tells each consumer which messages are its own, or a resource plugin that creates a topic or queue per environment. Message isolation for Kafka, SQS and more covers the pattern across brokers, and testing Kafka-based microservices in Kubernetes is the step-by-step version.

Workflow engines and batch jobs: Temporal and friends

Workflow engines such as Temporal and batch systems have the queue problem in a different shape: a worker polling a shared task queue will pick up any workflow, including one started by a test for someone else’s change. The fix is the same routing key. The workflow that a test starts carries the key, it passes the key to every activity, child workflow and job it starts, and the worker in that change’s ephemeral environment takes only the work tagged for it while the stable workers take the rest from the same task queues. Exactly one worker version processes each task, and no second Temporal cluster is needed. Testing Temporal workers on Kubernetes shows it end to end.

Resources tied to the environment’s lifecycle

Some changes need a resource of their own that the cluster does not have: a managed database, a topic, a storage bucket, a cache or a set of credentials. The general mechanism is a resource whose lifecycle is tied to the environment’s. Signadot’s resource plugins are create and delete steps a platform team writes once, with Helm, Terraform, a cloud CLI or a script. Signadot runs create when an ephemeral environment starts and delete when it ends, and hands outputs such as a host or credentials to the environment’s services as environment variables. A new framework for ephemeral resources explains the design. Full-copy platforms have their own versions: Bunnyshell’s Terraform components, Okteto’s external resources, Qovery’s lifecycle jobs, Northflank’s OpenTofu nodes and Release’s Terraform runner create cloud resources as part of an environment.

Workloads and resources outside Kubernetes

Real systems reach past the cluster, and an ephemeral environment has to account for that. Two cases differ. Cloud resources that a service uses, such as a managed database, a queue, a bucket or a cache, can be created per environment and deleted with it, through a resource plugin or a Terraform step in the environment’s definition. Services that themselves run outside Kubernetes, on VMs, ECS or serverless functions, are harder to copy per change, and in most setups every environment shares them. Signadot installs and runs in Kubernetes, and the services whose changes it isolates run there. Its resource plugins reach past the cluster for the cloud resources an environment needs, created with your own Terraform or cloud CLI when the environment starts and removed when it ends.

Third-party APIs, caches and secrets

Payment processors, identity providers and email services get the provider’s test account, with per-environment prefixes or idempotency keys so parallel environments do not collide on the same test customer. Redis, Memcached and S3-style buckets get a key prefix or path per environment and a cleanup hook on expiry, or a change that flushes a cache flushes it for everyone. Each environment gets its own scoped, rotated credentials, which External Secrets Operator can issue at provision time and revoke at expiry.

Do ephemeral environments need a service mesh?

No. A mesh solves the routing half of duplicating only what changed on a shared cluster, and it does that well, but the harder half is context propagation inside the application, which no mesh can do for you. Full-copy models do not need a mesh at all.

With Istio or Linkerd already in place, routing by header is a configuration change, which using Istio or Linkerd to unlock ephemeral environments walks through. What the mesh cannot do is carry the header across a service: when service A receives a tagged request and calls service B, A’s own code or instrumentation has to copy the tag to the outgoing call. OpenTelemetry baggage, which follows the W3C Baggage specification, does that through the tracing middleware most services already run. A service that drops the header silently sends the request to the stable version, which is the bug to test for first.

Teams on the Kubernetes Gateway API get the same from routes placed beside their HTTPRoutes. Without a mesh, the platform that manages the environments adds a lightweight sidecar to the services that need it. A mesh already in place is a head start, not a requirement.

What ephemeral environments cost

The cost of ephemeral environments scales with one of two things: every service in the system, or only the services each change duplicates. Take a system of 40 services where a typical change touches two. A full copy per change runs 40 service instances per environment. Duplicating only what changed runs the 40 stable versions once and adds two instances per change.

Concurrent environmentsFull copy per changeOnly what changed
140 instances42 instances
10400 instances60 instances
301,200 instances100 instances
1004,000 instances240 instances

A full copy bills for concurrency, not for the size of a change: a one-line fix and a schema migration cost the same 40 instances, and 100 open pull requests pay for 100 copies of the system whether anyone looks at them or not. Duplicating only what changed has a fixed cost, the shared stable versions, which is why it is not cheaper at one environment, and the gap widens with every environment after the first. Brex ran namespace-based previews across more than 800 microservices, moved to duplicating only what changed, and cut infrastructure cost by 99 percent, about $2 million a year, while preview creation fell from 30 to 60 minutes to under five.

In either model, a TTL that reclaims idle environments is the most effective single control, since most of an environment’s life is spent waiting for review. What ephemeral environments cost, and how teams keep the bill under control works through the cost drivers, the costs that never reach the invoice, the controls and the numbers at agent scale.

What AI coding agents change about ephemeral environments

Agents raise two numbers at once: the count of changes in flight, and the number of times each change needs an environment before it is done. An environment model sized for human throughput fails on both.

  • Volume. Agents are now a routine source of pull requests rather than an experiment. GitHub reported in May 2026 that more than one in five code reviews on the platform involve an agent, and the share of pull requests is higher still. A 50-engineer team built for 100 to 150 pull requests a day now faces closer to 1,000, as the agent PR flood works through.
  • The loop. A developer opens one pull request and waits for CI. An agent iterates: it makes a change, runs the tests, reads the failure and changes again, and it wants an ephemeral environment for every one of those attempts, not one per feature. Claude Code, Cursor, Codex and Copilot all work this way, and a loop that has to wait for a slot in a staging channel stalls. The agent feedback problem covers what that loop costs.
  • Validation before review. Testing AI-generated code in an ephemeral environment before a person looks at the pull request is what keeps the reviewer from becoming the verification layer. At Laurel, agent-authored pull requests rose from 55 percent to 76 percent in three months while change failure rate fell from 1.1 percent to 0.2 percent. The mechanics are in validating AI-generated code against real Kubernetes dependencies.
  • Per-run isolation. Put ten agent changes in one environment and a failing test names none of them, and an agent cannot fix what it cannot attribute. Each run needs its own environment, with its own identity in logs and traces.
  • Expiry as policy. Hundreds of runs a day stay affordable only if a run duplicates what it changed and nothing else, and every environment carries a TTL. An agent that creates environments and never deletes them is how a bill doubles in a week.
  • The interface. An agent creates, uses and destroys its environment through the tools it already has, a CLI, an MCP server or agent skills, not a console someone clicks. Background agents running in cloud sandboxes need one too, as the Modal example shows. The staging trap covers what that path looks like inside an enterprise cluster, and coding agent environments covers how Signadot packages it.

Ephemeral environments vs a shared staging environment: which works better?

For a monolith or a handful of services, a shared staging environment works better: it is cheap to run, stays current with main without effort, and a short queue costs less than the machinery to remove it. Past roughly 50 engineers and 25 services, ephemeral environments work better, and the setup that holds up keeps the shared staging cluster running the stable versions of every service while each change gets an ephemeral environment on top of it. At that size, teams can no longer stay in sync by talking to each other, the system no longer fits on a laptop, and several teams want staging at the same time.

Above it, the shared environment stops providing the stage it was built for: the queue grows with concurrent changes and the environment drifts faster than anyone can fix it. Coding agents move a team past that point sooner, since each one adds the concurrency of several developers without adding headcount.

There is also the argument for skipping pre-production testing and testing in production behind feature flags and canaries. That works for changes whose failure is observable and reversible in seconds, and not for schema migrations, payment flows or anything regulated. The stronger form of the argument is that the isolation a shared environment used to provide can be recreated per change inside production-like infrastructure, by duplicating only what each change needs.

Rolling out ephemeral environments: pitfalls and a checklist

Teams that make the transition without a stalled quarter follow the same sequence:

  1. Audit how often teams queue for the shared environment, where drift bites and what the always-on footprint costs.
  2. Pick a pilot team with frequent pull requests, real service dependencies and an existing CI pipeline. Do not attempt a big-bang migration.
  3. Decide deliberately between building and buying. Lyft and Razorpay built in-house, and neither did it as a side project.
  4. Plan the stateful dependencies before the pilot, not after the first corrupted test run.

Four pitfalls account for most failed rollouts:

  • Stateful and asynchronous dependencies. Databases, queues, workflow engines and third-party APIs need the patterns above in place first.
  • Observability. Environments that disappear take their evidence with them. Persist logs and traces beyond teardown and tag every span with the environment’s identity.
  • Culture and process. QA teams used to long-lived environments need a documented path and an early win, which preview environments for QA and stakeholder review covers.
  • Security and compliance. Restrict access by role, keep personally identifiable information out of test environments, and rotate per-environment credentials.

Ephemeral environments checklist

Twelve yes-or-no questions. A rollout that answers no to any of them has a known failure ahead.

  1. Does every environment have a trigger and a matching teardown, so nothing is created that nothing deletes?
  2. Does every environment carry a TTL that reclaims it without human action?
  3. Does an environment cost only what the change duplicates, or does cost scale with the whole stack?
  4. Can a developer, a CI job and a coding agent each create an environment through the same interface?
  5. Is the shared set of stable services kept green by a pipeline, with a named owner when it goes red?
  6. Does every service propagate the routing header on outgoing calls, with a test that fails when one drops it?
  7. Do schema changes and destructive writes get their own ephemeral datastore, and does it die with the environment?
  8. Are queue consumers and workflow workers isolated by environment, so a producer under test cannot feed the shared consumers?
  9. Do logs and traces carry the environment’s identity, and do they outlive it?
  10. Do test environments use sanitized data and per-environment credentials, with access limited by role?
  11. Can a reviewer or QA engineer reach a running environment by URL without asking anyone?
  12. Is there a number for environment count, cost and spin-up time, reviewed monthly?

How Signadot duplicates only what changed

Signadot is built on the fourth model, which duplicates only what changed. It multiplexes many ephemeral virtual environments within one physical environment, such as the staging cluster you already run. Each change gets one, called a Sandbox in Signadot’s API, that duplicates only what the change needs, usually the services it touched, next to the shared stable versions, plus its own database branch, topic or bucket when the change needs one. Each environment receives a unique routing key. Requests carrying that key in a header reach the forked services at every hop, messages carrying it reach the forked consumers, and everything else falls through to the stable ones.

KUBERNETES CLUSTERSHARED STABLE SERVICESDev, agent or CIchange to service-1Other requestsservice-1CHANGED VERSIONservice-1stableservice-2service-3dbtagged request from the changeother traffic
Only the changed version of service-1 is deployed for the change. Everything else it calls is shared.
Dev, agent or CIchange to service-1Other requestsKUBERNETES CLUSTERservice-1CHANGED VERSIONservice-1stableSHARED STABLE SERVICESservice-2service-3dbtagged request from the changeother traffic
Only the changed version of service-1 is deployed for the change. Everything else it calls is shared.

The prerequisites of the model are handled in the platform:

  • Routing goes through the mesh you already run, as the request routing docs describe. On Istio it is native, in sidecar or ambient mode, with no sidecar of its own. With the Gateway API it adds routes beside your HTTPRoutes and GRPCRoutes. With Linkerd or no mesh, a lightweight DevMesh sidecar routes requests. The routing key travels in OpenTelemetry baggage, which each service passes along.
  • Data and dependencies are isolated through resource plugins, which create a database branch, topic, bucket or other cloud resource for each environment when it starts and remove it when it ends, and through message routing for Kafka, RabbitMQ, SQS and SNS, Pub/Sub and NATS, where the Routes API tells each consumer which messages belong to its environment. The same routing key reaches Temporal workers and batch jobs.
  • Scale on one cluster comes from the operator design in creating sandboxes in Kubernetes at scale.
  • Local development connects the service on a developer’s laptop into an ephemeral environment, the same model pull requests and agents use.
  • The interface is a CLI, an API, an MCP server and agent skills, so a developer, a CI job and a coding agent all get an environment the same way, and every environment carries a TTL.
  • Deployment is hybrid. The operator and the ephemeral environments run in your cluster, and a thin SaaS control plane coordinates them. By default the control plane receives only resource metadata, such as workload names, namespaces, image references and status, never source code, image contents or application data, as the security and data docs describe. Signadot is SOC 2 Type II. For a fully self-hosted deployment, talk to us.

The concept docs describe the mechanism, and the ephemeral environments solution page covers how it is packaged. Signadot vs Garden sets it against a full stack per environment.

Where to go next

If you are still deciding whether a shared environment is enough, the complete guide to staging environments makes the balanced case. If cost is the question, start with what ephemeral environments cost. Environment parity covers how any of these environments stays production-like. If the driver is coding agents, start with validating AI-generated code on Kubernetes. For the tests that run inside these environments, layer by layer, see the complete guide to Kubernetes testing.

Frequently asked questions

What are ephemeral environments?

Ephemeral environments are temporary, isolated environments created on demand for one code change, pull request or test run, and deleted when that work is done. Each gives the change its own place to run against real dependencies, so teams test in parallel instead of queueing for a shared staging environment. They are built either by copying the whole environment per change or by duplicating only what changed inside a shared environment.

What are the best tools for ephemeral environments on Kubernetes?

It depends on how much of the system each change should duplicate. Platforms that copy the whole application per pull request include Bunnyshell, Release, Qovery, Northflank, Shipyard and Okteto's previews, and platform teams build the same with Argo CD ApplicationSets, Helm or vCluster. Signadot duplicates only what each change needs on a shared cluster, as do mirrord's Enterprise preview environments and Okteto's Divert mode, which keeps cost and spin-up low as ephemeral environments multiply.

Do ephemeral environments work better than a shared staging server?

For a team past roughly 25 services and 50 engineers, yes. A shared staging server turns into a queue and drifts as concurrent changes pile up, while ephemeral environments give each change its own place to test. Most teams keep the staging cluster anyway: it runs the stable versions of every service, and each change's environment runs on top of it with only the services that changed.

How do ephemeral environments handle stateful dependencies like databases and Kafka?

Three patterns cover nearly every case. Share the stable database when a change only reads or adds rows. Give the ephemeral environment its own database branch or temporary instance when the change alters a schema or writes destructively. For Kafka and other queues, either create topics per environment or tag messages with the environment's routing key so its consumers process only their own. Workflow engines such as Temporal use the same key.

How much do ephemeral environments cost at scale?

It depends on whether cost grows with every service or only with the changed ones. For a 40-service system with 30 open pull requests, a full copy per change runs 1,200 service instances. Duplicating only what changed runs the 40 shared services once plus two per change, about 100 instances. At agent-driven volumes of hundreds of concurrent ephemeral environments, that gap decides whether the bill is affordable.

How do ephemeral environments handle Temporal workers and task queues?

With the same routing key that isolates requests. A workflow started by a test carries the key and passes it to every activity and child workflow. The worker in that change's ephemeral environment polls the same task queue as the stable workers but takes only tasks tagged for it, so exactly one worker version processes each task, and no second Temporal cluster or task queue per environment is needed.

What is the difference between ephemeral and static environments?

A static or persistent environment, such as staging, QA or UAT, is provisioned once, kept running and shared by every change in turn. An ephemeral environment is created for one change and deleted when that change merges or closes. The difference is ownership of time, not size or fidelity, and most designs need both: a static set of stable services, with ephemeral environments running against it.

Do ephemeral environments require a service mesh like Istio?

No. A service mesh such as Istio, or the Kubernetes Gateway API, makes request routing for ephemeral environments on a shared cluster straightforward, because both can already route by header. But isolation also needs every service to propagate the routing header on outgoing calls, which is application work no mesh can do. Full-copy models need no mesh at all, and platforms that route requests add a lightweight sidecar when no mesh exists.

How do AI coding agents change ephemeral environment requirements?

Agents multiply both the number of changes and how often each one needs an environment. A person opens a pull request and waits. An agent such as Claude Code or Codex writes, tests, reads the failure and retries, so it needs an ephemeral environment on every attempt and cannot wait in a queue. That volume only fits a model where each environment costs the one or two services that changed and expires on its own.

Can a coding agent test its change in an ephemeral environment before opening a pull request?

Yes, if the environment can be created through the same interface the agent already uses, which in practice means a CLI or an MCP server rather than a console. The agent deploys its changed service into an ephemeral environment on the shared cluster, runs the integration tests against real dependencies, reads the result and iterates. The pull request it opens has already been validated, so the human reviewer is not the verification layer.

Stay in the loop

Get the latest updates from Signadot