Skip to content
Discussion options

You must be logged in to vote

Unable to attach or mount volumes: unmounted volumes=[static-pvc], unattached volumes=[], failed to process volumes=[static-pvc]: volume static-pvc has volumeMode Block, but is specified in volumeMounts

BlockMode volume needs to be specified in the volumeDevices not in volumeMounts, see below

spec:
  containers:
    - name: busybox
      image: busybox:latest
      volumeDevices:
        - name: static-pvc
          devicePath: /dev/xvda
      command: ["sleep", "3600"]
  volumes:
    - name: static-pvc
      persistentVolumeClaim:
        claimName: fs-static-pvc

Replies: 10 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Madhu-1
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by sarwo-star
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants