1. Worker Operations
  2. Maintain
  3. Upgrade a worker
Website
  • Worker operations
  • Kubernetes requirements
  • CPU and memory for workers and Jobs
  • Install a worker
  • Configure a worker
  • Scratch storage
  • Networking and egress
  • Worker security model
  • Worker health
  • Upgrade a worker
  • Troubleshooting

Upgrade a worker

Update the agent image, apply a generated one-Pod Recreate Deployment, verify the new agent, roll back safely, or uninstall the worker.

Loading documentation…

Worker health< PreviousTroubleshootingNext >

Powered by heyo

On this page

Before upgradingOne-time RBAC change for image reportingUpdate the agent imageApply a Deployment patchRoll backUninstall a worker

The worker list shows Update available when the running agent reports a different image digest from the available image, or reports no digest. The worker detail page shows an Agent update card with the command for your installation. Update required means the worker lacks the current execution capability and receives no checks until its agent is updated. An unknown digest can also mean the agent cannot read its own Pod; check its RBAC before treating the hint as proof of an older image. RestoreTrust never changes the agent Deployment itself; you run the update in your cluster.

Use the Agent deployment patch on the worker detail page when capacity or other Deployment settings change. It contains the current immutable agent image digest and preserves the one-Pod Recreate strategy.

Do not change the update strategy

Keep replicas: 1 and strategy.type: Recreate. A rolling update can run two Pods with the same worker identity, causing the replacement to be rejected.

Before upgrading

Record the running configuration for comparison:

bash
kubectl -n <AGENT_NAMESPACE> get deployment restoretrust-k8s-agent -o yaml > worker-deployment-before.yamlkubectl -n <AGENT_NAMESPACE> get pods -l app.kubernetes.io/name=restoretrust-k8s-agentkubectl -n <JOB_NAMESPACE> get jobs,pods

Note the exact:

  • agent and job namespaces;
  • scratch StorageClass;
  • Max parallel jobs value;
  • customer-added egress CIDR variables;
  • admission or scheduling settings your organization added to the Pod template.

When practical, wait for active checks to finish. Running Jobs are designed to continue through an agent restart and be reconciled by the replacement, but a quiet window makes verification and rollback simpler.

One-time RBAC change for image reporting

The agent now reads its own Pod to report the image digest. Before upgrading an existing installation, grant its ServiceAccount get on pods as well as pods/log in the agent namespace. The current generated Role and RoleBinding are named restoretrust-k8s-agent-self; the older restoretrust-k8s-agent-self-log pair grants only log access. Save this manifest with your agent namespace substituted, then apply it:

yaml
apiVersion: rbac.authorization.k8s.io/v1kind: Rolemetadata:  name: restoretrust-k8s-agent-self  namespace: <AGENT_NAMESPACE>rules:  - apiGroups: [""]    resources: ["pods", "pods/log"]    verbs: ["get"]---apiVersion: rbac.authorization.k8s.io/v1kind: RoleBindingmetadata:  name: restoretrust-k8s-agent-self  namespace: <AGENT_NAMESPACE>subjects:  - kind: ServiceAccount    name: restoretrust-k8s-agent    namespace: <AGENT_NAMESPACE>roleRef:  apiGroup: rbac.authorization.k8s.io  kind: Role  name: restoretrust-k8s-agent-self

Apply the saved file with kubectl apply -f agent-self-rbac.yaml. The namespace is specified in the manifest.

Verify both permissions before the image update:

bash
kubectl auth can-i --as=system:serviceaccount:<AGENT_NAMESPACE>:restoretrust-k8s-agent get pods -n <AGENT_NAMESPACE>kubectl auth can-i --as=system:serviceaccount:<AGENT_NAMESPACE>:restoretrust-k8s-agent get pods/log -n <AGENT_NAMESPACE>

Both commands should return yes. After the replacement agent reports its digest and live logs work, you can remove the obsolete restoretrust-k8s-agent-self-log Role and RoleBinding. The worker identity Secret does not change.

Update the agent image

  1. 1

    Compare the images

    The Agent update card shows the short digest of the image that runs and of the one that is available. The command uses the namespace from the Agent namespace field of the deployment patch; correct it there if you installed the agent elsewhere.

  2. 2

    Set the new image

    Copy the command from the card. It has this form:

    bash
    kubectl -n <AGENT_NAMESPACE> set image deployment/restoretrust-k8s-agent agent=<AGENT_IMAGE_REFERENCE>kubectl -n <AGENT_NAMESPACE> rollout status deployment/restoretrust-k8s-agent --timeout=5m

    It changes only the image. Capacity, scratch settings, customer-added environment values and the identity Secret stay as they are.

  3. 3

    Verify the new agent

    After the agent reconnects, the worker detail page shows the new digest and Up to date. If the agent image stays unknown, the agent may not read its own Pod: apply the current generated RBAC, which grants get on pods and pods/log in the agent namespace.

Apply a Deployment patch

  1. 1

    Update capacity if needed

    If the change includes Max parallel jobs, edit and save that value on the worker detail page first. Ensure storage quota, volume attachment limits, and node capacity support it.

  2. 2

    Generate the Deployment

    In Agent deployment patch, check the namespaces and scratch StorageClass against the running installation; they are pre-filled with what the agent last reported. Copy the generated YAML to worker-deployment.yaml.

    The identity Secret is deliberately not included or rotated.

  3. 3

    Review the diff

    Confirm that the image uses @sha256:..., replicas remain one, the strategy remains Recreate, and cluster-specific settings are preserved.

    bash
    kubectl -n <AGENT_NAMESPACE> diff -f worker-deployment.yaml

    Reapply approved RT_JOB_EGRESS_*_CIDRS values or other customer-owned Pod settings before continuing.

  4. 4

    Apply the Deployment

    bash
    kubectl -n <AGENT_NAMESPACE> apply -f worker-deployment.yamlkubectl -n <AGENT_NAMESPACE> rollout status deployment/restoretrust-k8s-agent --timeout=5m

    Recreate stops the old Pod before starting the new one.

  5. 5

    Verify service

    Confirm there is exactly one agent Pod. In RestoreTrust, check Online, Accepting jobs: Yes, and the expected capacity.

    Run a representative manual check and verify its scratch PVC and execution NetworkPolicy.

The detail-page patch updates the Deployment only. If RestoreTrust release guidance requires RBAC, namespace, or egress admission changes, follow those release-specific instructions; do not broaden permissions by inference.

Roll back

If the new Pod does not become healthy:

  1. collect its current and previous logs;
  2. restore the previous Deployment revision;
  3. wait for the one replacement Pod;
  4. verify the worker returns Online and accepts jobs.
bash
kubectl -n <AGENT_NAMESPACE> rollout undo deployment/restoretrust-k8s-agentkubectl -n <AGENT_NAMESPACE> rollout status deployment/restoretrust-k8s-agent --timeout=5m

Do not restore or rotate the identity Secret during an image rollback.

Uninstall a worker

Uninstalling removes the worker record from RestoreTrust and requires separate cleanup in your cluster.

  1. 1

    Move or pause schedules

    Edit every schedule that selects this worker. Assign a healthy replacement worker or pause the schedule.

  2. 2

    Wait for active checks

    Wait until no check is running on the worker. RestoreTrust refuses to remove a worker with running checks.

    bash
    kubectl -n <JOB_NAMESPACE> get jobs,pods
  3. 3

    Stop the agent

    Scale the Deployment to zero so it cannot reconnect while you remove the worker.

    bash
    kubectl -n <AGENT_NAMESPACE> scale deployment/restoretrust-k8s-agent --replicas=0
  4. 4

    Remove the worker in RestoreTrust

    On the worker detail page, choose Uninstall and confirm the exact worker name. The identity becomes unusable.

  5. 5

    Remove cluster resources

    If both namespaces are dedicated to this worker, delete them after confirming no required Secret or retained data remains:

    bash
    kubectl delete namespace <AGENT_NAMESPACE> <JOB_NAMESPACE>

    If you applied the optional cluster-scoped admission objects, inspect them and delete them only when they target this removed job namespace and protect no other installation.

Namespace deletion is destructive

Deleting the job namespace permanently removes local source and decryption Secrets, Jobs, Pods, PVCs, and any retained restore data. Back up anything your policy requires before deletion.

Related topics

  • Monitor worker health
  • Configure a worker
  • Troubleshoot an upgrade