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

Unable to provision volumes on all nodes with StorageClass with Custom Node Labels #356

Open
khalMeg opened this issue Dec 16, 2024 · 2 comments
Labels
to-be-scoped Need scoping

Comments

@khalMeg
Copy link

khalMeg commented Dec 16, 2024

I am using openEBS localpv LVM with a StorageClass with Custom Node Labels (for all my worker nodes). However, volumes are always provisioned on node worker-01, and if I cordon worker-01 volumes will never be scheduled on different nodes.

workaround : if I create a new storage class for a specific node (other than worker-01) the volume is provisioned without any problem.

here is my storage class:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: main-sc
annotations:
allowVolumeExpansion: true
parameters:
  thinProvision: "yes"
  storage: "lvm"
  volgroup: "data"
  fsType: "xfs"
provisioner: local.csi.openebs.io
allowedTopologies:
- matchLabelExpressions:
  - key: kubernetes.io/hostname
    values:
      - worker-01
      - worker-02
      - worker-03
      - worker-04
     
kubectl get pods -n openebs
NAME                                             READY   STATUS    RESTARTS       AGE
openebs-localpv-provisioner-6bd66f8598-nnzzv     1/1     Running   2 (4d3h ago)   17d
openebs-lvm-localpv-controller-6bbd64786-kvbw4   5/5     Running   0              17d
openebs-lvm-localpv-node-2plnt                   2/2     Running   8 (17d ago)    39d
openebs-lvm-localpv-node-bw68q                   2/2     Running   8 (17d ago)    39d
openebs-lvm-localpv-node-nb7wl                   2/2     Running   0              38h
openebs-lvm-localpv-node-vjpgb                   2/2     Running   0              13d
openebs-zfs-localpv-controller-b8bc9ff46-x9k9w   5/5     Running   0              17d
openebs-zfs-localpv-node-bmgl6                   2/2     Running   13 (17d ago)   39d
openebs-zfs-localpv-node-lsh8p                   2/2     Running   9 (17d ago)    39d
openebs-zfs-localpv-node-n6p8p                   2/2     Running   0              38h
openebs-zfs-localpv-node-r9lmd                   2/2     Running   0              13d

Environment:

  • LVM Driver version
LVM version:     2.03.16(2) (2022-05-18)
Library version: 1.02.185 (2022-05-18)
Driver version:  4.47.0
  • Kubernetes version :
Client Version: v1.30.4
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.30.4
  • Kubernetes installer & version:
    k8s cluster deployed using Kubespray
  • OS:
    Debian GNU/Linux 12 (bookworm)
@sinhaashish sinhaashish added the to-be-scoped Need scoping label Jan 16, 2025
@abhilashshetty04
Copy link
Contributor

Hi @khalMeg ,

Can you share the new storage class with which provisioning works for other node.

Please also see the docs for custom label in storage class

https://openebs.io/docs/user-guides/local-storage-user-guide/local-pv-lvm/lvm-configuration#storageclass-with-custom-node-labels

@khalMeg
Copy link
Author

khalMeg commented Jan 16, 2025

Hi @abhilashshetty04
It is the same storageClass only with different node selected. This is the only way I can go about provisioning on nodes other than worker-01.

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: w2-sc
allowVolumeExpansion: true
parameters:
  thinProvision: "yes"
  storage: "lvm"
  volgroup: "data"
  fsType: "xfs"
provisioner: local.csi.openebs.io
allowedTopologies:
- matchLabelExpressions:
  - key: kubernetes.io/hostname
    values:
       - worker-02

The same issue occurs when I use a storage class without specifying any node; the volumes are always provisioned on worker-01!

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: main-sc
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
allowVolumeExpansion: true
parameters:
  thinProvision: "yes"
  storage: "lvm"
  volgroup: "data"
  fsType: "xfs"
provisioner: local.csi.openebs.io

Please note that I am using Thin Provisioning in my LVM setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to-be-scoped Need scoping
Projects
None yet
Development

No branches or pull requests

3 participants