coreos / torus

Torus Distributed Storage
https://coreos.com/blog/torus-distributed-storage-by-coreos.html
Apache License 2.0
1.77k stars 172 forks source link

After flexprepvol failed to execute, torus keeps trying to attach the volume #399

Open nak3 opened 7 years ago

nak3 commented 7 years ago

version

issue

step to reproduce (just an example step)

1. Create volume with wrong fsType.

kubectl create -f nginx.yaml
apiVersion: v1
kind: Pod
metadata:
  name: nginx
spec:
  containers:
  - name: nginx
    image: nginx
    volumeMounts:
    - name: test
      mountPath: /data
    ports:
    - containerPort: 80
  volumes:
  - name: test
    flexVolume:
      driver: "coreos.com/torus"
      fsType: "foo"
      options:
        volume: "testvol"
        etcd: "10.254.0.2:2379"
2. Check log
# kubectl get pod
NAME          READY     STATUS              RESTARTS   AGE
nginx        0/1       ContainerCreating   0          2m
# journalctl --no-pager |grep foo
Nov 19 08:10:54 torus1 torus[9227]: mkfs: failed to execute mkfs.foo: No such file or directory

Actual result

# kubectl get event -w
...
2016-11-19 08:10:54 +0000 UTC   2016-11-19 08:10:54 +0000 UTC   1         nginx    Pod                   Warning   FailedSync    {kubelet fed-node}     Error syncing pod, skipping: mount command failed, status: Failure, reason: failed
2016-11-19 08:11:08 +0000 UTC   2016-11-19 08:14:37 +0000 UTC   16        nginx    Pod                   Warning   FailedMount   {kubelet fed-node}     Unable to mount volumes for pod "nginx2_default(b0ea44f1-ae2f-11e6-9746-5254007c7544)": attach command failed, status: Failure, reason: Couldn't attach
2016-11-19 08:11:08 +0000 UTC   2016-11-19 08:14:37 +0000 UTC   16        nginx    Pod                   Warning   FailedSync    {kubelet fed-node}     Error syncing pod, skipping: attach command failed, status: Failure, reason: Couldn't attach

Expect result