Update a cluster agent
Update the agent that runs in a cluster from the console, roll it back, and re-apply the install manifest when an older cluster needs new permissions.
A control plane update does not touch your clusters. Each cluster's agent updates on its own, from the console, when you start it. Workloads keep running during the update.
Before you begin
- You need the admin or owner role, and a session or a token without project limits.
- The cluster must be connected.
- No deployment or build may be running on the cluster. Deployments that wait for approval do not count.
- The control plane offers an agent image newer than the one the cluster runs. The default is the
ghcr.io/nebulactrl/nebula-agentimage published with the control plane's own version, named by its digest (ghcr.io/nebulactrl/nebula-agent@sha256:DIGEST). The--agent-imageserver flag overrides it, and an image in that repository must carry a digest or the control plane does not start. A development build has no digest and offers the version's tag, which the cluster's admission policy refuses; use a released image. A tagged image must be 0.34.1 or newer, and not newer than the control plane.
Update the agent
- Open Clusters and select the cluster.
- In the header, select Update agent. The button appears when an update is available. You can also use Update agent under Settings > Agent. In the cluster list, Update agent in the context menu opens the cluster's overview, where the header button is.
- Watch the button. It reads Updating… and stays disabled from the click until the update has finished, on every page that shows it. In Settings > Agent, the Version row reads
Updating to TAG…until the new agent reports in. A message says how the update ended.
Settings > Updates lists every cluster under cluster agents with its node count and agent version. A cluster whose agent image differs from the one the control plane offers has an Update agent button in its row. When two or more clusters trail, Update all agents updates them one after another. Each row reads Waiting, Updating…, Updated, Rolled back, Failed or Not started, and the results stay listed when the run ends. After a successful control plane update, the same page shows "Cluster agents are updated separately. These still run an older version." and a row for each cluster that trails, with an Update agent button. The rows stay while any agent trails.
To start the update from the API:
curl -s -X POST \
-H "Authorization: Bearer $NEBULA_TOKEN" \
-H "Content-Type: application/json" \
-d '{}' \
https://nebula.example.com/api/v1/clusters/CLUSTER_ID/agent/updateAn empty body uses the control plane's agent image. Send {"image": "IMAGE"} to choose one. NEBULA_TOKEN is an API token and CLUSTER_ID the cluster's id.
What the update does
- The control plane records the target image and sends the update command.
- A second component, the access broker, patches the agent's Deployment to the new image. The agent cannot patch its own Deployment. The broker can change only that image, and only to
ghcr.io/nebulactrl/nebula-agentpinned by digest. A cluster installed before 0.42.0 also accepts a tag until you re-apply the install manifest. - Kubernetes rolls the Deployment out one extra pod at a time with no pod unavailable. The old agent keeps running until the new one can reach the control plane.
- The update is Healthy when the new agent reports the target image. The pod's image is what counts, not the Deployment's.
- If the new agent has not reported within the deadline, the update is closed as Rolled back with
the new agent did not report in within 10 minutes, and the control plane starts a rollback to the previous image by itself. The deadline is the--agent-update-deadlineserver flag and defaults to 10 minutes. A rollback that also times out ends Failed.
An update can also fail to start. The console shows Could not update the agent on CLUSTER, followed by the reason, and the current agent keeps running. The usual refusals:
| Message | What to do |
|---|---|
an agent update is already running on this cluster | Wait for it to finish. |
the cluster must be connected before its agent can be updated | Bring the agent online first. |
wait for the deployments and builds on this cluster to finish, then update the agent | Wait, or cancel the build or deployment. |
this cluster already runs IMAGE | Nothing to update. |
Roll back to an earlier agent
- Open Settings > Agent on the cluster.
- In Agent history, find the attempt you want to undo. The table lists Attempt, From → to, Kind, Status and Started.
- Select Roll back, then Roll back again in the confirmation.
After you re-apply the install manifest, the cluster accepts only digest-pinned agent images. A rollback to an earlier attempt that ran a tag fails and the current agent keeps running.
What an update changes in the cluster
- The agent's image. Nothing else in the Deployment changes.
- Four custom resource definitions. The agent applies
builds.nebula.dev,domains.nebula.dev,releases.nebula.devandworkloads.nebula.deveach time it starts, so an update brings newer fields with it. Its cluster role lets it patch and update only those four definitions. - No RBAC. An update never changes roles, role bindings or namespaces. The broker gives the agent access to each environment's namespace. Those permissions come from the install manifest, including the
pods/execpermission the browser shell needs. See Open a shell and browse files in an instance. - No registry change. An update never changes the registry, its roles or its admission policies. Registry authentication comes from the install manifest. See Turn on registry authentication on an older cluster.
Re-apply the manifest on an older cluster
An agent installed before it gained permission to update the definitions cannot apply them. It logs one warning and keeps running. The warning begins:
cannot update the nebula.dev CustomResourceDefinitions: the agent's ClusterRole predates this version and may not update the nebula.dev CustomResourceDefinitions, so the cluster keeps the ones it has and features that need newer fields (such as file mounts) stay unavailableBuilds and deployments that need a newer field are then refused with a message that tells you to re-apply the agent manifest. One example begins this cluster's build policy, Build CRD or agent predates Railpack builds. To re-apply it:
- Open the cluster's Settings > Agent. Beside Install credentials, select Regenerate, then confirm. The running agent keeps its token and stays connected. The new token only re-applies the manifest on the existing server, and it is spent as soon as the manifest is fetched, so run the command straight away.
- Copy the Install command and the One-time token. The token is shown once and expires in one hour.
- Run the command as root on a server node of that cluster. Paste the token at the silent
NebulaCtrl token:prompt.
The script is safe to run again, but each run needs a newly issued token. If the apply step fails after the token was fetched, regenerate and run the command again.
To move the cluster to a rebuilt server instead, select Replace agent. The running agent's token stops working at once, the cluster reads Awaiting agent, and the first server you install with the new token takes over. Workloads keep running meanwhile, but nothing deploys.
Since 0.42.0 the manifest also confines build jobs, enforces the restricted Pod Security level in the agent's namespace and narrows the access broker's permission on nodes. Update the agent first, then re-apply the manifest:
- An updated agent keeps building under the manifest you applied before. Its build jobs pass the older, looser policy.
- An agent that is not updated cannot create build jobs under the new policy: its jobs have no resource limits, and the policy refuses them.
- The broker of an updated agent reads volume usage with the new, narrower permission, and falls back to the old one until you re-apply. A broker that is not updated loses volume usage once the manifest drops the old permission, and volumes read not reported.
Turn on registry authentication on an older cluster
Since 0.42.0 the cluster's build registry accepts only requests that carry a credential. Each build pushes to its own repository, each environment namespace pulls only the repositories it runs, and only the agent deletes. An agent update does not change the registry. The registry changes when you re-apply the manifest, and the agent turns authentication on after that.
- Update the agent as described above. Wait until the cluster reads connected and no build is running.
- Re-apply the install manifest as described above. Before it applies the manifest, the script hands an existing registry volume to the registry's new non-root user. If the volume is on another node, the script prints the directory and the
chowncommand to run on that node. Restart the registry there. - Wait a minute. The agent gives each environment namespace a pull credential, then turns authentication on.
Until authentication is on, the registry still answers requests that carry no credential, as it did before. A build or deployment that runs while you re-apply the manifest can fail once. Start it again. An environment the console holds, for example because its variables do not resolve, keeps authentication off until the console releases it. The agent log names the namespaces it waits for.
To check that authentication is on, read the flag the agent sets:
kubectl -n nebula-system get configmap nebula-registry-auth-state -o jsonpath='{.data.enforce}'The output is true. Then send a request without a credential from a server node:
curl -s -o /dev/null -w '%{http_code}' http://localhost:30500/v2/401If a deployment then reads The cluster's registry refused to give SERVICE its image IMAGE, its namespace has no pull credential yet. Deploy again in a minute. If the message stays, re-apply the manifest again. See Deployments.
Rotate the agent token
The agent's bearer token never expires on its own. To replace it without re-enrolling, open the cluster's Settings > Agent and select Rotate token beside Agent token. This needs the Admin role, and the cluster must be connected.
- The control plane sends the agent a new token over its open connection.
- The agent stores it and confirms with it. The row then reads Rotated with the time.
- The previous token keeps working for 10 minutes, so both agent replicas can pick up the new one, then stops.
An agent that does not confirm within 20 seconds keeps its current token, and a message says so. The usual cause is an agent older than this feature: update it, then rotate again. Until the agent confirms, the row reads Rotation pending; a second rotation is refused for 30 seconds, then replaces the pending one.
Verify
- The Version row shows the new version and
latest. - Agent history lists the attempt as Healthy.
- The cluster is connected and its workloads are unchanged.
Next steps
Set a cluster's tenant policy
Choose which private LAN and tailnet destinations a proxy process may publish from a cluster, and which extra storage classes its volumes may use, in the console or through the API.
Run builds on a dedicated node
Reserve one node of a cluster for builds, so a repository's Dockerfile never runs on the nodes that host your services, the agent or its access broker.