Autoscaling Temporal workers on Kubernetes with the Worker Controller

The Temporal Worker Controller manages versioned worker deployments on Kubernetes, routing new workflows to a new build while old versions drain and scale. This page explains what it does, the decisions it forces, and what to confirm before you run it in your cluster.

On this page

Autoscaling Temporal workers on Kubernetes with the Worker Controller: when teams need it

A platform team that ships workflow code changes while long-running workflows are still open has a versioning problem before it has a scaling problem. The Temporal Worker Controller runs each worker version as its own Kubernetes deployment, sends new workflow executions to the version you choose, and keeps older versions running until the work pinned to them finishes. It also scales each version's workers, so the deployment for a version that is draining does not compete with the one that is taking new work for the same resources.

The core ideas are simple to state. A rainbow deployment is one Kubernetes deployment per worker build, so v1 and v2 of a workflow codebase run side by side. Routing decides which version receives new executions, and that decision changes only when you promote a version. Draining keeps an old version alive until its open executions complete, then retires it. Autoscaling adjusts the replicas of each version against its own task queue load, which matters because an old version with a few stubborn workflows may need far fewer workers than the new one.

A plain Deployment with a Helm chart is often enough when workflows are short, you can tolerate a brief cutover, or you deploy rarely. Evaluate the controller when open workflows routinely outlive a release, when you need several versions live at once, or when rollouts are frequent enough that manual draining becomes error-prone. Confirm the controller version and its supported Kubernetes versions against the current release notes before you commit. In every case, the workers run in your own cluster, while the Temporal Server runs separately, either self-hosted or on Temporal Cloud, so the cluster design and the server design are separate decisions.

How the Worker Controller fits between Temporal and your cluster

The flow starts in the CI pipeline, which builds a worker image for each release and hands it to the cluster. Inside the Kubernetes cluster, the Worker Controller manages one worker deployment per build version and routes new workflow starts to the current version. Workers poll task queues on the Temporal Service, which is either self-hosted or Temporal Cloud, using credentials held in the cluster. Check the trust boundary: the Kubernetes API and Temporal credentials should sit on the cluster side only. This is a generic architecture, not a verified controller internals chart.

Generic architecture showing build, control and task flow across the cluster boundary.

What the Worker Controller manages in each rollout

The Worker Controller treats each workflow code version as its own worker set, then decides where new work goes and when old sets can go away. The four components below share one rollout, so a decision in one card changes what the others must wait for.

One worker set per version

Each workflow code version runs in its own set of worker Deployments, so old and new code run side by side while open workflows keep the code they started with. The platform team decides how versions are named, how many may run at once, and who approves a build before it enters the cluster. Confirm in the controller's current documentation how it creates these per-version resources and how it handles a version whose workers fail health checks. Each version gets its own worker pods.

Routing new starts to the target

The controller moves new workflow executions to the version you mark as the target, while executions already running stay on the version that started them. The team decides when the target changes, usually after the new workers are healthy and have processed test traffic, and who may move it back. Confirm how the controller checks readiness before routing, what happens to starts during a switch, and whether rolling back is a single target change. New starts follow only the target version.

Draining old versions

A previous version stays deployed until every open workflow it started has completed, and only then are its workers retired. The team decides whether any old version may be force-retired after a deadline, and who accepts the risk of stopping workflows that are still waiting on timers or signals. Confirm how the controller counts open executions for each version, how it behaves when visibility data lags behind, and what it reports while a version is draining. Old workers stay until their open work finishes.

Autoscaling each version's workers

Each version's worker set scales on its own, so a backlog in the new version does not starve the old version that is still finishing its work. The team decides the scaling signal, the minimum and maximum replica counts for each version, and how draining versions shrink as their work completes. Confirm which metrics the controller supports for scaling, how it coordinates with the Kubernetes autoscaler, and how scale-down interacts with the shutdown settings in your pod specifications. Each version scales independently.

Decisions to make before the first versioned rollout

This table compares the five decisions that shape a Worker Controller setup on Kubernetes: how versions are identified, how traffic moves, when an old version is safe to retire, what signal scales each version, and whether versions share a task queue. Read each row as a choice to settle in writing before the first rollout, with the cost of getting it wrong and the points to confirm in the controller documentation. The main takeaway is that drain and scaling choices are harder to change after workers are live than naming or ramp speed.

DecisionWhen the choice fitsOperational effort and what to confirm in the controller docs
Build version identifier and taggingUse a version derived from the container image digest or a CI build number when each release must map to exactly one worker deployment.Low to set up, but every pipeline must emit the same identifier. Confirm the exact field the controller reads from the worker deployment and how it names versioned resources.
Routing cutover: all at once or gradual rampA full cutover suits small, low-risk changes with good test coverage. A gradual ramp suits changes to workflow code or activity behavior that you want to observe under real traffic first.A ramp needs someone watching metrics during each step and a clear rollback trigger. Confirm how the controller sets the traffic split, whether the split is manual or automated, and how a rollback is triggered.
Definition of a drained versionDefine drained as no open workflow executions pinned to that build and no pending tasks on its queues, checked before any retirement. Use this when workflows run for days or longer.Requires a check of open executions per build, which takes Temporal visibility queries. Confirm which signal the controller uses to decide a version is drained and whether it waits for in-flight workflows or only for routing.
Autoscaling signal per versionTask queue backlog suits activity-heavy queues where latency matters. Worker resource use such as CPU or memory suits CPU-bound activities. Choose per version, because old and new builds may have different load profiles.Backlog signals need reliable metrics export into the cluster's autoscaling stack. Confirm which metrics the controller exposes, how they map to a scaling target per version, and the minimum and maximum replica behavior it supports.
Shared or separate task queues across versionsA shared queue lets newer and older workers serve the same work, which suits compatible changes. Separate queues per version suit breaking changes, because workflows stay pinned to the build that started them.Shared queues depend on strict workflow versioning in code. Separate queues add routing and monitoring work and more queues to alert on. Confirm how the controller assigns task queues to each version and whether it supports both patterns.

Setting up the Temporal Worker Controller in your cluster

This sequence takes a cluster from no controller to one where versioned Temporal workers are routed, drained and scaled by the controller. Each step names its owner and the evidence that closes it, so the platform team and the Temporal operator can sign off before production traffic depends on the setup.

  1. Confirm the Temporal Server version and upgrade state

    The Temporal operator records the running Temporal Server minor and patch versions and confirms they sit on a supported minor line. Upgrades move one minor version at a time, to the latest patch of the current minor first, and schema upgrades run before server upgrades when the release notes call for them. Check the Helm chart version too: chart versions below 0.73.1 do not work with server images 1.30 and later. Evidence: a written version record that matches the server image tag and the chart version in your Helm release.

  2. Check Kubernetes version against support and skew

    The platform team confirms the cluster's minor version is one of the three most recent Kubernetes minor releases the project maintains. It then reviews the version skew policy, which requires kube-apiserver to be upgraded first and allows kubelets to run up to three minor versions behind it. Evidence: saved output of the cluster and node version listing, attached to the change record, showing the control plane and kubelets sit inside the skew window.

  3. Install the controller from its current release

    The platform team installs the Temporal Worker Controller using the steps in its current release documentation and pins the controller version in version control. The install record should name the Temporal namespace the controller watches and the service account permissions it receives. Confirm the controller pod is ready and its logs show a successful connection to the Temporal frontend. Evidence: a healthy controller pod, a pinned version in the repository, and a log entry confirming the connection.

  4. Add build version metadata to worker images

    The platform team and application developers add a build identifier to each worker image so the controller can tell versions apart. Set the identifier in the CI pipeline so the same value appears in the image tag and the deployment manifest, and make it unique per build. Confirm the field names and the mechanism your controller version expects in its documentation. Evidence: a CI run that publishes an image carrying the identifier, and a running pod that reports the same identifier.

  5. Define the namespace and task queues

    The Temporal operator creates the Temporal namespace for the workers and lists every task queue the deployment will poll, with an owner and an expected workload for each. Confirm retention and access settings with the Temporal service owners before any worker connects. Check that task queue names in the worker code match the reviewed list exactly. Evidence: the namespace description output and an approved task queue inventory that the worker configuration references.

  6. Load Temporal credentials from a secrets store

    The platform team stores the client certificate, key or API credential that workers use to reach the Temporal frontend in an external secrets store. Pods receive it through the Secrets Store CSI Driver or your standard mechanism. Kubernetes Secrets are stored unencrypted in etcd by default, so enable encryption at rest and restrict list and watch access with least-privilege RBAC. If the Temporal Server has no Authorizer configured, it allows every request, so confirm authorization on the server before this step closes. Evidence: a pod reading the credential from a mounted path, and an RBAC check showing other service accounts cannot read it.

  7. Run a first rollout to a non-production namespace

    Deploy a versioned worker build to a non-production namespace and run a test workflow that lands on the new version. Then send a routing update that moves new executions to the new version, and confirm the previous version drains by finishing its open workflows before its pods are removed. Investigate any workflow that stays on the old version longer than the team expects. Evidence: a test run record showing the new version handled new executions, and old pods removed only after their in-flight work completed.

  8. Enable autoscaling and worker alerts

    The platform team turns on autoscaling for the worker deployment only after drain behavior is verified, so scale-down events do not interrupt running work. It then sets alerts for worker health signals such as exhausted slots, stopped pollers and schedule-to-start latency, and links each alert to a runbook entry. Confirm the metric names in your monitoring stack before writing alert rules. Evidence: scaling events in the controller and autoscaler logs, plus a test alert that fires on a deliberate condition and then resolves.

Why draining old versions decides when a rollout is safe

A rollout is safe only when no workflow still depends on the old build. Temporal pins each workflow execution to the worker code that started it, so a workflow begun on an older version must finish on a worker that still runs that code. Removing the old deployment on a timer strands every execution that outlives the timer, and those executions then wait on a task queue with no compatible poller. The old version should stay in service until its drain condition is met, and that condition depends on the workflows still open, not on the clock.

Define drain completion from your own workflow data. Measure how long each workflow type normally runs, including retries and timeouts, then add a margin your team agrees on. Confirm the drain rule against the Worker Controller documentation, since the exact settings for keeping an old version alive and sunsetting it are controller-specific. Long-running and scheduled workflows change the answer: a schedule can start new runs on the old build, and a workflow that waits on a signal for days can hold an old version open well past normal duration. For each such type, decide whether it will migrate through a versioning change, be allowed to finish on the old build, or be stopped by a planned process, and write that decision down before cutover.

Test drain behavior in a staging namespace before production. Deploy version N, start representative workflows including the slowest and any scheduled ones, then cut routing to version N+1 and confirm that new starts land on the new build. Check the open execution count for the old build in the Web UI or with the CLI, and confirm that the old deployment does not scale to zero while that count is above zero. Include one deliberately slow workflow so you can see whether drain completes early. Repeat the test after every change to autoscaling settings, since a scale-down rule can end drain before the workflows do.

Security controls for worker pods and Temporal credentials

The worker controller, the worker pods and the Temporal Service all hold access to each other, so a gap in one layer exposes the others. The cards below cover the controls that matter most for this setup, in the order a reviewer usually checks them. DeployOpen configures and tests these controls in your environment, but it does not issue audit reports or certifications.

Encrypt Secrets at rest

Kubernetes stores Secrets unencrypted in etcd by default, and Temporal client certificates, API keys and codec keys often end up there. Enable encryption at rest for the API server, or keep the credentials in an external store and mount them through the Secrets Store CSI Driver. Check that etcd snapshots taken for backup are protected with the same care as the live data, because a snapshot contains the same Secret values.

Secrets good practices

Scope the controller's RBAC

The Worker Controller must create Deployments and scale them for every versioned worker, which makes its ServiceAccount one of the most powerful identities in the namespace. Grant it only the verbs and namespaces it needs, and restrict list and watch on Secrets for every workload identity. Review bindings after each controller upgrade, since a new release can request additional permissions.

Apply Pod Security Standards

Worker pods run application code that often handles customer data, so they should not run privileged or with host namespaces. Label the worker namespaces to enforce the Restricted Pod Security Standard where the worker image allows it, and test in warn mode first. Confirm that the Temporal worker image runs as a non-root user with a read-only root filesystem before enforcement.

Pod Security Standards

Keep the Temporal Service private

Self-hosted Temporal ships with the default noopAuthorizer, which allows every API request with no authentication. Keep the frontend off the public internet, require mTLS between services, and map client certificate or JWT claims to namespace roles through a ClaimMapper with an Authorizer. Test each worker identity against a namespace it should not reach, and confirm the request is refused.

Self-hosted security docs

Review the cluster against CIS

The CIS Kubernetes Benchmark gives a set of configuration checks for the control plane, worker nodes and policies that a reviewer can run against your cluster. Use it as a baseline for the nodes and namespaces that run the controller and workers, and record each check as passed, failed or accepted with a reason. Treat the results as input for your own assessor, since a benchmark run does not certify the cluster.

Questions teams ask before hiring help with worker rollouts

What drives the cost and effort of a Worker Controller setup?

The main drivers are how ready your cluster already is, how many task queues and worker versions you run, where the Temporal Service is hosted, and how much testing the rollout needs. A cluster with working autoscaling, ingress, observability and a build pipeline needs less groundwork than one that does not. Each task queue and each active worker version adds routing, scaling and drain steps to design and verify. Secrets and RBAC design for Temporal namespace credentials adds review time, and drain testing with workflow owners adds more. Ask any provider for a written quote that lists each of these items separately, with what is one-time setup and what the team must run afterward.

How long does a Worker Controller rollout take?

Duration depends mostly on the same factors as cost: cluster readiness, the number of task queues and versions, the depth of drain testing, and how fast your workflow owners can review behavior. A single queue on a cluster with a working pipeline is a much smaller job than several languages, queues and environments sharing one controller setup. Ask the provider to state the phases, the dependencies on your team, and the acceptance tests in the written scope before you agree a date. Treat any duration you hear without that breakdown as a guess.

What does our team need to provide for the engagement?

Plan to provide four things before work starts:

  • Cluster access with rights to install the controller, create namespaces and set RBAC for worker deployments
  • A Temporal namespace and the credentials workers will use, with a decision on how those secrets are stored
  • Access to the build pipeline that produces worker images and version labels
  • Named workflow owners who can confirm how long-running workflows behave when an old version is drained

Missing any of these usually moves the schedule, since the controller cannot route or drain versions without them.

Can our platform team do this alone, and where does a partner usually help?

A capable platform team can install and operate the controller alone, especially if it already runs Kubernetes workloads with GitOps and observability. Teams often find the harder parts are the design decisions: how versions map to rainbow deployments, how routing changes are sequenced, when an old version is safe to drain, and how autoscaling interacts with those steps. A partner usually helps by writing the design, building the first queue end to end, running drain tests with workflow owners and handing over runbooks. Decide which of these your team will own after handover before you ask for a quote.

Does Temporal Cloud change the Worker Controller work?

Temporal Cloud changes the service side, not the worker side. Your workers still run in your Kubernetes cluster, so the controller, deployment, routing, drain and autoscaling work remains. What changes is that Temporal operates the Temporal Service, so the server upgrades, persistence and visibility setup described for self-hosted deployments no longer apply to your team. Connectivity, identity and namespace credentials still need design. Pricing for Temporal Cloud is published on the Temporal pricing page, and the quote from your provider should state which costs sit with Temporal and which sit with your team.

How do Kubernetes and Temporal upgrades affect the controller?

Kubernetes upgrades affect the controller through API changes and the version skew rules, which require the control plane to move one minor version at a time before nodes follow. Test the controller and its custom resources on the target Kubernetes version in a non-production cluster before the production upgrade. Temporal Server upgrades follow their own rule: move one minor version at a time to the latest patch of the current minor, and run schema upgrades first when release notes require them. Your worker SDK version also changes worker behavior, so plan a new worker version as a rainbow deployment rather than an in-place change. Ask the provider how upgrade testing and rollback are handled in the written scope.

What should we verify before accepting the handover?

Verify behavior under real conditions rather than only a clean install. Check that a new worker version receives traffic only after it is ready, that the old version drains without failing in-flight workflows, and that autoscaling responds to task queue backlog. Confirm that secrets are stored in a way your security team has approved, since Kubernetes Secrets are not encrypted at rest by default unless you configure encryption. Ask for the acceptance test list, the drain test results with your workflow owners, and the runbooks for routing changes and rollbacks in the written acceptance criteria.

Temporal Worker Controller limits to confirm before you commit

The Worker Controller combines versioned worker deployments, traffic routing and autoscaling, and each of those parts has limits that depend on your versions and workload. The cards below list what to confirm with the controller maintainers and the Temporal documentation before you build the pipeline around it.

Controller release and maturity

Confirm which Worker Controller release you would deploy, its release notes, and whether it is marked for production use. Ask the maintainers how breaking changes are announced and how long older controller releases receive fixes. Pin the controller version in your own Helm or GitOps configuration so an upgrade is a planned change, not a side effect of a chart update. Record the controller release next to the Temporal Server version in your runbook.

Temporal Server and Kubernetes version support

Check the controller's compatibility matrix against the Temporal Server minor you run. The Temporal upgrade guidance expects one minor version at a time, so the controller must support both the version you leave and the one you move to. On the Kubernetes side, the project maintains 1.37, 1.36 and 1.35 as of September 2026, and kubelets may be up to three minor versions older than kube-apiserver. Confirm which of those your cluster and the controller both support.

Maintained Kubernetes minors
1.35 to 1.37
Kubernetes skew policy

Fit of the autoscaling signal

The controller scales worker pods on a signal that must match your workload. Confirm which metric it uses, such as task queue backlog or schedule-to-start latency, and whether that signal reflects the task queues you run. Ask how it handles tasks that are long-running, rate-limited or concentrated on one partition, and how quickly it can scale down without interrupting in-flight activities. Test the signal with a load profile that resembles production before you rely on it.

Serverless and non-Kubernetes workers

The controller manages workers that run as Kubernetes deployments. If some workers run on serverless compute, on virtual machines or in another scheduler, the controller will not manage their versions or scaling. Confirm whether the controller's versioning and routing apply only to its own worker deployments, and plan a separate rollout process for anything outside the cluster. The separate serverless workers page covers how Temporal starts those workers on demand.

Routing model for pinned workflows

Long-running workflows stay on the worker version they started with, so each version you keep alive uses capacity until its workflows finish. Confirm how the controller moves new executions to a new version, how it decides when an old version can drain and be removed, and whether it can keep a version pinned while the workflows it serves are still open. Ask the maintainers how they handle a version that has open workflows but no traffic, and confirm the behavior against the Temporal worker versioning documentation before you accept it.

How DeployOpen works on this

DeployOpen plans and delivers Temporal worker rollouts on Kubernetes inside your own clusters, starting from a written scope that names the workers, task queues and versions involved. The work covers Worker Controller setup, routing and drain procedures, and the autoscaling configuration that goes with them, documented so your platform team can run it.

How we scope

  • Inventory the Temporal workers, task queues, SDKs and current deployment method before any design work starts.
  • Agree in writing which Kubernetes clusters, namespaces and Temporal Service deployments the rollout touches.
  • Confirm whether autoscaling uses Kubernetes metrics, Temporal metrics or both, and who owns the alerting thresholds.
  • Engagements are fixed-scope, with deliverables and timelines agreed before work starts.

How we build

  • Install and configure the Temporal Worker Controller in your clusters with versioned worker deployments per build.
  • Define routing update and drain steps so new workflows reach the new version and old versions finish in-flight work.
  • Tie autoscaling settings to measured worker load, and test scale-up and scale-down against a staging Temporal namespace.
  • Check Kubernetes termination settings against the worker shutdown behavior your SDK and workflows need.

How we hand over

  • Deliver manifests, Helm values and runbooks for deploying, routing, draining and rolling back each worker version.
  • Document the version skew and upgrade order for your Kubernetes control plane and the Temporal Server it talks to.
  • Walk your platform and on-call engineers through a supervised rollout and a failed-rollout rollback drill.
  • Record the configuration decisions and their reasons so future changes to workers can be reviewed.

How we support

  • Ongoing support, Worker Controller upgrades and continuous testing are available as retainers.
  • Re-test autoscaling and drain behavior after Kubernetes minor upgrades, using the release schedule your cluster runs on.
  • Review worker alerts and rollout logs with your team, and confirm each alert routes to a documented runbook.
  • Confirm with your team which support scope and response expectations fit your environment before signing.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.