Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raw Block Volume support #302

Open
Bytamine opened this issue Oct 11, 2024 · 0 comments
Open

Raw Block Volume support #302

Bytamine opened this issue Oct 11, 2024 · 0 comments

Comments

@Bytamine
Copy link

Hello,
I'm trying to understand if it's possible to mount ISCSI volume in raw block mode as specified here:
https://kubernetes.io/docs/concepts/storage/persistent-volumes/#raw-block-volume-support
There is no example on how to do it, so it is possible that I missed something.

Here is my full yaml configuration:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: iscsi-pv-vm-block-storage
spec:
  storageClassName: iscsi
  accessModes:
    - ReadWriteOnce
  volumeMode: Block
  capacity:
    storage: 100Gi
  csi:
    driver: iscsi.csi.k8s.io
    volumeHandle: iscsi-data-id
    volumeAttributes:
      targetPortal: "192.0.4.10:3260"
      portals: "[]"
      iqn: "iqn.2001-05.com.equallogic:0-6694d6-047520d8d-e90bc5aeb1267069-iscsi11-emanthos"
      lun: "0"
      iscsiInterface: "default"
      discoveryCHAPAuth: "true"
      sessionCHAPAuth: "false"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: iscsi-pvc-vm-block-storage
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Block
  resources:
    requests:
      storage: 100Gi
  storageClassName: iscsi
  volumeName: iscsi-pv-vm-block-storage
---
apiVersion: v1
kind: Pod
metadata:
  labels:
    run: nginx-block
  name: nginx-block
spec:
  containers:
  - image: nginx
    name: nginx
    volumeDevices:
    - name: block-disk
      devicePath: /dev/xvda
  volumes:
  - name: block-disk
    persistentVolumeClaim:
      claimName: iscsi-pvc-vm-block-storage

and here is what I see in pod describe:

Mounting command: mount
Mounting arguments:  -o bind /var/lib/kubelet/plugins/kubernetes.io/csi/volumeDevices/publish/iscsi-pv-vm-block-storage/8f1f0c45-8be8-48be-af7e-d56221efd3cf /var/lib/kubelet/plugins/kubernetes.io/csi/volumeDevices/iscsi-pv-vm-block-storage/dev/8f1f0c45-8be8-48be-af7e-d56221efd3cf
Output: mount: /var/lib/kubelet/plugins/kubernetes.io/csi/volumeDevices/iscsi-pv-vm-block-storage/dev/8f1f0c45-8be8-48be-af7e-d56221efd3cf: mount point is not a directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant