How can I safely change resturl for glusterfs storage class on my Kubernetes cluster?

5/8/2019

Heketi pod was restarted on our Kubernetes Cluster and now I'm struggling with how to change glusterfs storage class resturl with new heketi endpoint.
What are the safest options without any data loss on our PVCs? I was able to recreate Kubernetes Cluster v1.11.10 on our test environment and start investigating on it. When I tried to edit storage class I got:

"StorageClass.storage.k8s.io "glusterfs" is invalid: parameters Forbidden: updates to parameters are forbidden."

We are using Kubernetes v.1.11.10.
I tried to create new storage class with correct heketi endpoint, but I couldn't edit PVCs:

PersistentVolumeClaim "test-pvc" is invalid: spec: Forbidden: is immutable after creation except resources.requests for bound claims 

I was able only to delete old storage class and create new with correct heketi resturl.

-- Oles Rid
glusterfs
kubernetes
kubernetes-pvc

2 Answers

5/8/2019

I found an answer here why it's not working with internal DNS heketi service name Set up Heketi Rest URL in Storage Class issue

-- Oles Rid
Source: StackOverflow

5/8/2019

You may try to use "kubectl replace" like that:

kubectl replace -f storage-class.yaml --force 

Just make sure that you use Heketi Service name as a REST URL to avoid further such issues.

-- Vasily Angapov
Source: StackOverflow