charts icon indicating copy to clipboard operation
charts copied to clipboard

unable to change localprovisioner path

Open Sam-Lin-MillersLab opened this issue 3 years ago • 7 comments

So if you set it wrong in the first time, you can't change it. Not even uninstall the chart and reinstall it

I am using 2.7.0

Sam-Lin-MillersLab avatar Mar 19 '21 17:03 Sam-Lin-MillersLab

I hope this query is related to openebs hostpath volume. By default /var/openebs/local is the path in the host where data is saved for the volumes. This information is present in the annotation of storage class.

kubectl get sc openebs-hostpath -o jsonpath='{.metadata.annotations.cas\.openebs\.io\/config}'

- name: StorageType
  value: "hostpath"
- name: BasePath
  value: /var/openebs/local

There are 2 options if we want to save the data in some other place in the host.

  1. If we pass localprovisioner.basePath in helm values it reflects in the storage class.
  2. We can create a new storageclass and consume that for our application.

Here is one sample storageclass

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: updated-openebs-hostpath
  annotations:
    openebs.io/cas-type: local
    cas.openebs.io/config: |
      - name: StorageType
        value: "hostpath"
      - name: BasePath
        value: "/var/openebs/local"
provisioner: openebs.io/local
volumeBindingMode: WaitForFirstConsumer
reclaimPolicy: Delete

shovanmaity avatar Jun 14 '21 07:06 shovanmaity

I have tested this in 2.9.0 openebs version. @Sam-Lin-MillersLab PTAL if this solves your use case.

shovanmaity avatar Jun 14 '21 07:06 shovanmaity

Hi @shovanmaity -- is it possible to install the same chart with a modified value?

kmova avatar Jun 16 '21 17:06 kmova

Yes it is possible, like point 1 in the comment. This value is used in 2 places.

  • In default storage class.
  • As env in localpv-provisioner. This is useful when base path is not present in sc. If we helm upgrade of existing installation, storageclass will not be updated but env will be updated.

shovanmaity avatar Jun 23 '21 05:06 shovanmaity

@Sam-Lin-MillersLab - do you still need a fix for this one?

kmova avatar Aug 18 '21 10:08 kmova

well, sorry, I haven't had a chance to test it. you can close it if you want. i will report if it doesn't work.

Sam-Lin-MillersLab avatar Aug 18 '21 12:08 Sam-Lin-MillersLab

Fresh installation here. I tried to define an alternative basepath in the values.yaml. But in my case the entire values.yaml is ignored.

helm install openebs-test -n open-ebs openebs/openebs -f values.yaml
  • The kubectl get sc openebs-hostpath -o jsonpath='{.metadata.annotations.cas\.openebs\.io\/config}' shows the default path. - When changing the SC name of the openebs-hostpath, it doesn't deploy the SC with the specified name.
  • When disabling the openebs-device SC, it ignores this and still deploys. (Tried both deprecated and new definition)
enableDeviceClass: false
...
  deviceClass:
    # Name of default device StorageClass.
    name: openebs-device

Also tried a fresh install with;

defaultStorageConfig:
  enabled: "false"

Anything else to check?

D1StrX avatar Mar 16 '24 22:03 D1StrX