Resolution
Fix the cluster's storage, not the agent. The agent's PersistentVolumeClaim (PVC) stays Pending when nothing in the cluster can create a volume for it. Make sure the PVC's StorageClass has a working provisioner, then reinstall the agent from a clean state.
Usually the class's CSI driver isn't installed, is turned off, or lacks the cloud permissions it needs. Your provider's CSI driver docs, linked in step 5 of Diagnosis and fix, explain how to set it up. If the cluster has no default StorageClass, mark a working one as the default, or add --set persistence.storageClassName="<class-name>" to the install command.
If you need the agent running while you fix storage, Kubernetes agent v3 can still use the bundled NFS server. Add --set persistence.nfs.enabled="true" and --set persistence.accessModes="{ReadWriteMany}", and make sure the NFS CSI driver is installed. This option is deprecated and is removed in agent v4, which ships with Octopus Server 2027.1, so treat it as temporary.
Symptom
The Helm install command from the Kubernetes agent wizard runs for about 5 minutes, then fails and rolls back the release:
Error: INSTALLATION FAILED: release <release-name> failed, and has been uninstalled due to rollback-on-failure being set: resource PersistentVolumeClaim/<namespace>/octopus-agent-<release-name>-pvc not ready. status: InProgress, message: PVC is not Bound. phase: Pending
resource Deployment/<namespace>/octopus-agent-tentacle not ready. status: InProgress, message: Available: 0/1
context deadline exceeded
Older Helm versions print a shorter message that ends in context deadline exceeded or timed out waiting for the condition and doesn't name the PVC.
While the command runs, you'll also see:
- The
octopus-agent-tentaclepod staysPendingand writes no logs. - The Kubernetes monitor pod can start and connect to Octopus Server normally, so its logs show no errors.
- The health check for the new deployment target in Octopus fails or never completes.
The PVC has no volume:
$ kubectl get pvc -n <namespace>
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE
octopus-agent-<release-name>-pvc Pending <class-name> <unset> 3m
The Tentacle pod can't be scheduled, and the PVC is waiting for a provisioner that never acts:
Warning FailedScheduling default-scheduler 0/3 nodes are available: pod has unbound immediate PersistentVolumeClaims. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling.
Normal ExternalProvisioning persistentvolume-controller Waiting for a volume to be created either by the external provisioner '<provisioner>' or manually by the system administrator. If volume creation is delayed, please verify that the provisioner is running and correctly registered.
Scope: when this is the right article
Use this article when all of these are true:
- You're installing or upgrading a Kubernetes agent or Kubernetes worker on Helm chart v3.
- The agent PVC,
octopus-agent-<release-name>-pvc, showsPendingand has no volume. - The PVC's events show no volume being created, or a
ProvisioningFailederror from the storage driver.
This isn't the right article if:
| What you see | Where to go instead |
|---|---|
Helm fails right away with an error about the --atomic flag, before any pods start |
Helm 4.0.0 through 4.1.2 rejects --atomic. Replace it with --rollback-on-failure or upgrade Helm. Kubernetes agent installation wizard has outdated Helm instructions (GitHub issue #10000) tracks the wizard fix, released in Octopus Server 2026.4.10772. |
The PVC requests ReadWriteMany from a block-storage class such as gp2, gp3, Azure Disk, or GCE persistent disk, and its events mention an unsupported access mode |
Block storage only supports ReadWriteOnce. Use a ReadWriteMany-capable class, or request ReadWriteOnce, as the Octopus storage docs describe. |
| You're moving a v2 agent off the bundled NFS server, and the NFS install step is missing from the wizard | The v3 wizard no longer installs NFS or the NFS CSI driver. Follow the v2 to v3 migration guide. If the new PVC is still Pending after migration, come back to this article. |
The PVC is Bound, but the Tentacle pod still fails |
The problem isn't storage. Check connection details, token expiry, and networking in the Kubernetes agent troubleshooting docs. |
Cause
The agent can't start because the cluster never creates a volume for its PVC.
The Kubernetes agent needs shared storage so the Tentacle pod can write files that script pods read. From v3, the chart no longer runs its own NFS server by default. It requests a 10Gi ReadWriteOnce volume from the cluster's default StorageClass, or from the class you set in persistence.storageClassName.
A PVC only binds when a provisioner creates a matching PersistentVolume (PV), or when an administrator has already created one. If the StorageClass points at a driver that isn't installed, isn't running, lacks cloud permissions, or can't meet the request, no PV appears. The PVC stays Pending, the Tentacle pod can't be scheduled, and Helm times out and rolls back.
A StorageClass can appear in kubectl get storageclass even when its driver is missing or turned off, so a listed class doesn't prove the cluster can provision with it.
Diagnosis and fix
Steps 1 to 8 only read from the cluster, apart from a throwaway test namespace in step 7. Steps 9 to 12 change the cluster. In every command, <namespace> is the namespace from the agent's install command (the wizard's namespaces start with octopus-agent-) and <release-name> is the Helm release name from the same command.
1. Inspect the agent's resources while Helm is running
Helm deletes the PVC and pods when it rolls back, so inspect them before the timeout. To get more time, add --timeout 15m to the install command. While it runs, open a second terminal and run:
kubectl get pvc,pods -n <namespace>
kubectl describe pvc -n <namespace>
kubectl describe pods -l app.kubernetes.io/name=octopus-agent -n <namespace>
kubectl get events -n <namespace> --sort-by=.lastTimestamp
Save the output. Octopus Support will ask for it if you open a ticket.
2. Read the PVC's events
Run kubectl describe pvc -n <namespace> and match the newest event at the bottom of the output:
| Event | What it means | Next step |
|---|---|---|
WaitForFirstConsumer |
Expected. The class waits for a pod to be scheduled before it creates a volume. | Step 3 |
ExternalProvisioning repeating, with no Provisioning event after it |
The provisioner named in the message isn't running or isn't registered. | Step 5 |
ProvisioningFailed |
The provisioner ran and failed. The message says why. | Step 6 |
FailedBinding with no persistent volumes available for this claim and no storage class is set, or no events and a blank StorageClass
|
The PVC has no StorageClass and the cluster has no default. | Step 4 |
3. Read the Tentacle pod's scheduling events
Run the following and look for FailedScheduling events:
kubectl describe pods -l app.kubernetes.io/name=octopus-agent -n <namespace>
-
pod has unbound immediate PersistentVolumeClaims: the PVC is the blocker. Read the PVC's events withkubectl describe pvc -n <namespace>. -
volume node affinity conflict: the volume was created in a zone where the pod can't run. This is a topology problem, covered in step 6. -
Insufficient cpu,Insufficient memory, orUntolerated taint: the pod can't be scheduled for reasons unrelated to storage. AWaitForFirstConsumerclass keeps the PVCPendinguntil the pod can be scheduled, so fix scheduling first.
4. Check that the PVC's StorageClass exists
kubectl get pvc -n <namespace> -o custom-columns=NAME:.metadata.name,CLASS:.spec.storageClassName,MODES:.spec.accessModes,SIZE:.spec.resources.requests.storage
kubectl get storageclass
-
CLASSis blank and no class is marked(default): The cluster has no default StorageClass. Fix it in step 9. -
CLASSnames a class that isn't listed: Class names are case-sensitive and must match exactly. Correct the name in the install command. -
More than one class is marked
(default): Kubernetes uses the most recently created default, which might not be the one you expect. Remove the default annotation from the others. -
MODESis[ReadWriteMany]and the class is block storage: Block storage only supportsReadWriteOnce. Use aReadWriteMany-capable class, or requestReadWriteOnce, as the Octopus storage docs describe.
5. Confirm the provisioner is installed and running
Find the class's provisioner, then check that a matching CSI driver is registered. Replace <class-name> with the class from step 4:
kubectl get storageclass <class-name> -o jsonpath='{.provisioner}{"\n"}'
kubectl get csidriver
The provisioner must appear in the kubectl get csidriver list. A legacy in-tree provisioner such as kubernetes.io/aws-ebs hands its work to a CSI driver, in that case ebs.csi.aws.com, so that driver must be listed instead.
If the driver is missing, turned off, or not running, install or turn it on by following your provider's docs. The same docs cover the cloud permissions the driver needs:
-
Amazon EKS: Amazon EBS CSI driver for
ReadWriteOnce, Amazon EFS CSI driver forReadWriteMany -
Azure AKS: Azure Disk CSI driver for
ReadWriteOnce, Azure Files CSI driver forReadWriteMany -
Google GKE: Compute Engine persistent disk CSI driver for
ReadWriteOnce, Filestore CSI driver forReadWriteMany - Red Hat OpenShift: Configuring CSI volumes
Two gaps come up often. On GKE, turning on the Cloud Filestore API for a project doesn't turn on the Filestore CSI driver for a cluster. On EKS 1.23 and later, gp2 classes that use kubernetes.io/aws-ebs need the EBS CSI driver, as the EBS CSI migration FAQ explains.
6. Match a ProvisioningFailed message to its cause
Run kubectl describe pvc -n <namespace> and read the ProvisioningFailed message:
| Cause | What the message shows | Fix |
|---|---|---|
| Missing cloud permissions |
UnauthorizedOperation, AccessDenied, PermissionDenied, or 403
|
Grant the driver the permissions listed in your provider's CSI driver docs. |
| Cloud quota or capacity | Quota, limit, or insufficient capacity errors | Raise the quota with your provider, or use another zone, tier, or class. |
| Size outside the class's limits | Errors about the requested capacity or size | Check the class's size limits in your provider's docs, then set --set persistence.size="<size>". The chart default is 10Gi. |
| Zone or topology mismatch | Errors about zones or topology, or volume node affinity conflict on the pod |
Use a class with volumeBindingMode: WaitForFirstConsumer so the volume is created in the pod's zone. Check that any allowedTopologies in the class include zones that have nodes. |
| Network misconfiguration on file-storage classes | Errors about the network or VPC | Check the class's network settings against your provider's CSI driver docs. |
| Unsupported access mode | Errors about access modes or volume capabilities | Block storage only supports ReadWriteOnce. Use a ReadWriteMany-capable class, or request ReadWriteOnce, as the Octopus storage docs describe. |
A namespace ResourceQuota on storage behaves differently. It rejects the PVC when Helm creates it, so Helm fails right away with exceeded quota instead of waiting for the timeout. Check quotas with kubectl describe resourcequota -n <namespace>.
7. Test provisioning outside Octopus
This test shows whether the cluster can create a volume with the same class, access mode, and size the agent requests. If the test PVC also stays Pending, the problem is the cluster's storage, not the agent or Octopus.
Save this as storage-test.yaml, replacing <class-name> with the class from step 4. If the agent requests ReadWriteMany or a different size, change those values to match:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: storage-test-pvc
namespace: storage-test
spec:
accessModes:
- ReadWriteOnce
storageClassName: <class-name>
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: Pod
metadata:
name: storage-test-pod
namespace: storage-test
spec:
containers:
- name: test
image: busybox:1.36
command: ["sh", "-c", "echo ok > /data/ok && sleep 3600"]
volumeMounts:
- name: data
mountPath: /data
volumes:
- name: data
persistentVolumeClaim:
claimName: storage-test-pvc
Create the test, watch the PVC for a few minutes, then delete the namespace:
kubectl create namespace storage-test
kubectl apply -f storage-test.yaml
kubectl get pvc -n storage-test --watch
kubectl delete namespace storage-test
-
The test PVC stays
Pending: The cluster can't provision with this class. Runkubectl describe pvc storage-test-pvc -n storage-testand use steps 2, 5, and 6 to find the cause. - The test PVC binds but the agent's doesn't: Compare the class name, access mode, and size in the agent's install command with the test values.
8. If this started after an upgrade, check what the old agent used
An upgrade often exposes a storage problem that already existed. A bound volume keeps working when its driver breaks, so the problem only shows when something asks for a new volume. List existing volumes and claims:
kubectl get pv -o custom-columns=NAME:.metadata.name,NAMESPACE:.spec.claimRef.namespace,CLAIM:.spec.claimRef.name,CLASS:.spec.storageClassName,DRIVER:.spec.csi.driver,STATUS:.status.phase
kubectl get pvc -A
-
The old agent's PV used
nfs.csi.k8s.io: The v2 agent used the bundled NFS server and never asked the cluster for a volume. The v3 agent's PVC may be the first that does, so the cluster's provisioning may never have worked. Fix storage with steps 9 to 12, or keep the bundled NFS server for now. It's removed in agent v4 with Octopus Server 2027.1. -
Older PVCs on the same class are
Bound, but recent ones arePending: Provisioning broke after those volumes were created, for example after a cluster upgrade that moved volumes to a CSI driver that wasn't installed. The agent was just the next workload to ask for a volume. Fix the driver using step 5. - No PVC on that class has ever bound: The class has never worked in this cluster. Install its driver or choose another class.
-
Helm fails an in-place upgrade with
spec is immutable after creation: The upgrade tried to change the existing PVC's class or access mode. Follow the v2 to v3 migration guide.
9. Correct the StorageClass
Choose one option. Option B is the safest because it doesn't affect other workloads.
Option A: Mark a working class as the cluster default. Any workload that creates a PVC without a class then gets this class:
kubectl patch storageclass <class-name> -p '{"metadata":{"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
Option B: Name the class for the agent only. Enter it in the storage class field of the wizard's advanced setup, or add this to the install command:
--set persistence.storageClassName="<class-name>"
Option C: Create a new class. If no existing class fits, for example when an EKS cluster only has the legacy gp2 class, create one from the example in your provider's CSI driver docs. Then use Option A or B with its name.
10. Clean up the failed attempt
A rollback normally removes the release and the PVC. Check for leftovers before you reinstall:
helm list -n <namespace> --all
kubectl get pvc -n <namespace>
If the release is still listed, uninstall it. If the PVC is still listed, delete it:
helm uninstall <release-name> -n <namespace>
kubectl delete pvc octopus-agent-<release-name>-pvc -n <namespace>
11. Reinstall the agent
The bearer token in the wizard's command expires after 1 hour, so generate a new command if the old one is older than that. Add the storage values you settled on in step 9, plus a size only if the class needs one:
helm upgrade --install --atomic \
<values from the installation wizard> \
--set persistence.storageClassName="<class-name>" \
--set persistence.size="<size>" \
<release-name> \
oci://registry-1.docker.io/octopusdeploy/kubernetes-agent
On Helm 4.0.0 through 4.1.2, replace --atomic with --rollback-on-failure. If you use a ReadWriteMany class, also add --set persistence.accessModes="{ReadWriteMany}", or check the ReadWriteMany box in the wizard.
12. Pre-provision a volume if dynamic provisioning isn't available
If the cluster can't create volumes on demand, create a PV yourself and bind it to the agent's PVC. The chart names the PVC octopus-agent-<release-name>-pvc. Confirm the exact name from a failed attempt with kubectl get pvc -n <namespace>.
Save this as octopus-agent-pv.yaml. Replace the nfs block with the volume source for your storage, and keep the capacity and access mode at least as large as the agent's request:
apiVersion: v1
kind: PersistentVolume
metadata:
name: octopus-agent-<release-name>-pv
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: octopus-agent-static
claimRef:
namespace: <namespace>
name: octopus-agent-<release-name>-pvc
nfs:
server: <nfs-server-address>
path: <export-path>
Apply it, then install the agent with the matching class name:
kubectl apply -f octopus-agent-pv.yaml
--set persistence.storageClassName="octopus-agent-static"
The claimRef reserves the PV for the agent's PVC, so no other workload can claim it.
Verify
The fix worked when the PVC is Bound, the Tentacle pod is Running, and a health check passes in Octopus.
-
Check that the Helm command finished without an error.
-
Check the PVC.
STATUSshould beBound, with a volume name and capacity:
kubectl get pvc -n <namespace>
- Check the pods.
octopus-agent-tentacleshould beRunningwithREADYat1/1:
kubectl get pods -n <namespace>
- Check the Tentacle logs for errors:
kubectl logs -l app.kubernetes.io/name=octopus-agent -n <namespace>
- In Octopus, go to Infrastructure ➜ Deployment Targets, open the agent, and run a health check from its Connectivity page. The health check runs in a script pod, so a pass also shows that script pods can mount the shared volume.
The Helm command can take longer than the wizard waits, so the wizard's first health check might fail even after the fix. If Helm finishes successfully after that, run the health check again.
Related
Octopus documentation
-
Kubernetes agent storage: the v3
ReadWriteOncedefault, custom StorageClasses, and CSI driver setup links for EKS, AKS, GKE, and OpenShift. -
Kubernetes agent troubleshooting: other causes of
context deadline exceededduring installation, and health check errors. - Version-specific notes: how to install the NFS CSI driver if you keep the bundled NFS server on v3.
- Kubernetes Agent bundled NFS storage deprecation: the deprecation notice for the bundled NFS server.
- NFS removal announcement for the Kubernetes agent (GitHub issue #554): the schedule for removing bundled NFS in agent v4 with Octopus Server 2027.1.
- Kubernetes agent v2 to v3 migration guide: chart changes between v2 and v3, including storage.
- Kubernetes agent installation wizard has outdated Helm instructions (GitHub issue #10000): the wizard fix for Helm 4 and default storage, released in Octopus Server 2026.4.10772.
Kubernetes documentation
- Kubernetes StorageClasses: default classes, provisioners, and volume binding modes.
- Kubernetes persistent volumes: how PVCs bind to PVs, including pre-provisioned volumes.