Timeout when attaching volumes in Kubernetes


  • A big amount of files in a volume causes a timeout when trying to attach the said volume
  • There’s a timeout when waiting for volumes to attach when using Kubernetes
  • There’s a timeout when trying to attach volumes to a Jenkins instance or Master
  • I am seeing a warning or an event similar to the one below when trying to attach a volume:
  Unable to mount volumes for pod "<POD_IDENTIFIER>": timeout expired waiting for volumes to attach or mount for pod "jenkins"/"<POD_NAME>". list of unmounted volumes=[output]. list of unattached volumes=[output <VOLUMES>]



The solution for the problem is removing fsGroup from the Pod template.

Explanation: When mounting the volume k8s won’t try to change ownership of many different files from the volume and then won’t trigger the timeout.

Tested environment

  • AKS - Azure Kubernetes Service
  • EKS - Amazon Kubernetes Service


Have more questions?


Please sign in to leave a comment.