digitalocean/csi-digitalocean

Problem while existing pod gets updated - multi-attach error.

bukowa opened this issue · 2 comments

What did you do? (required. The issue will be closed when not provided.)

  1. Create a deployment with PVC.
  2. Update a deployment (changed docker image).
  3. Because new pod is created on other node than the running one - there's multi-attach error:
Multi-Attach error for volume "pvc-xxx" Volume is already used by pod(s) xxx-
MountVolume.SetUp failed for volume "xxx" : failed to sync secret cache: timed out waiting for the condition
Unable to attach or mount volumes: unmounted volumes=[xxx], unattached volumes=[xxx xxx default-token-xxx ]: timed out waiting for the condition

What did you expect to happen?

  1. New pod is created on the same node.

Configuration (MUST fill this out):

Will provide if needed but i don't think it has anything to do with my configuration - otherwise please prove me wrong and i will post.

  • CSI Version:
    I don't know where to find this, the cluster runs on DO managed kubernetes.

  • Kubernetes Version:

Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.3", GitCommit:"1e11e4a2108024935ecfcb2912226cedeafd99df", GitTreeState:"clean", BuildDate:"2020-10-14T12:41:49Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"linux/amd64"}
  • Cloud provider/framework version, if applicable (such as Rancher):
    DigitalOcean

👋 The approach I'd recommend is to use a StatefulSet. It guarantees that old pods are terminated before new ones come up. This also rules out potential data corruption due to multiple pods accessing the same storage.

Let me know if that works for you.

Thansk ill try that!