Skip to content

Volume not detached/migrated after node failure/shutdown #164

@mrkamel

Description

@mrkamel

I've a simple echoserver pod running on one of three nodes with a 10gb hetzner volume using the csi driver.
When i shut down the node where the pod is running on, the pod can't be migrated to another node as it gets stuck in ContainerCreating

# kubectl get pods
NAME                          READY   STATUS              RESTARTS   AGE
echoserver-6b45d446c5-8lhdg   0/1     ContainerCreating   0          11m
echoserver-6b45d446c5-dk7cd   1/1     Terminating         0          29m

I'm using the latest driver with kubernetes 1.19.
The log is telling me

INFO[2020-11-22 13:12:01] I1122 13:12:01.154989    1010 reconciler.go:224] operationExecutor.VerifyControllerAttachedVolume started for volume "pvc-bbea2704-6e0f-4230-88eb-a2803bef1600" (UniqueName: "kubernetes.io/csi/csi.hetzner.cloud^8133269") pod "echoserver-6b45d446c5-8lhdg" (UID: "d984870c-c8c7-42c2-9d90-d9e0d250a124")   component=kubelet
INFO[2020-11-22 13:12:01] E1122 13:12:01.165803    1010 nestedpendingoperations.go:301] Operation for "{volumeName:kubernetes.io/csi/csi.hetzner.cloud^8133269 podName: nodeName:}" failed. No retries permitted until 2020-11-22 13:14:03.165677786 +0100 CET m=+1239.114378880 (durationBeforeRetry 2m2s). Error: "Volume not attached according to node status for volume \"pvc-bbea2704-6e0f-4230-88eb-a2803bef1600\" (UniqueName: \"kubernetes.io/csi/csi.hetzner.cloud^8133269\") pod \"echoserver-6b45d446c5-8lhdg\" (UID: \"d984870c-c8c7-42c2-9d90-d9e0d250a124\") "  component=kubelet

The hetzner cloud panel still shows the volume attached to the shut down node.
When i power on the shut down node again and let it join, the pod and volume can finally be migrated to the new node, but i thought this would not be a neccessity.

My echoserver.yaml:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: csi-pvc
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
  storageClassName: hcloud-volumes
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: echoserver
spec:
  replicas: 1
  selector:
    matchLabels:
      app: echoserver
  template:
    metadata:
      labels:
        app: echoserver
    spec:
      containers:
      - image: gcr.io/google_containers/echoserver:1.4
        imagePullPolicy: Always
        name: echoserver
        ports:
        - containerPort: 8080
        volumeMounts:
        - mountPath: "/data"
          name: my-csi-volume
      volumes:
      - name: my-csi-volume
        persistentVolumeClaim:
          claimName: csi-pvc
---
apiVersion: v1
kind: Service
metadata:
  name: echo
spec:
  type: NodePort
  selector:
    app: echoserver
  ports:
    - port: 8080
      nodePort: 30100

Am i missing some config i'm not aware of? Or is this desired?
Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions