profile
viewpoint

Ask questionsAllow updating rbd monitors of persisted volumes

Is this a BUG REPORT or FEATURE REQUEST?: Probably a bit of both.

/kind bug /kind feature /sig storage

What happened: We needed to move our ceph cluster which in turn gave the ceph monitors new ips. In k8s the ips are stored in the storageclass and in each pv. We updated the storageclass successfully but trying to update a pv it fails:

$ kubectl patch pv pvc-9841e253-d453-11e8-a2fe-0ec0b66da86e -p $'spec:\n rbd:\n  monitors: ["10.0.1.2:1234"]'
The PersistentVolume "pvc-9841e253-d453-11e8-a2fe-0ec0b66da86e" is invalid: spec.persistentvolumesource: Forbidden: is immutable after creation

What you expected to happen: It should be possible to change the monitors easily.

How to reproduce it (as minimally and precisely as possible): Create a rbd backed PV and try to change the monitors section afterwards.

Environment:

  • Kubernetes version (use kubectl version): v1.11.3
kubernetes/kubernetes

Answer questions alwinmarkcf

I may found another way.

I was able to export the resource via:

kubectl get pv <mypv> -o yaml > /tmp/mypv.yaml

Then add/change/remove the monitors from /tmp/mypv.yaml

Now we can apply the changes dirty via:

kubectl replace --cascade=false --force -f /tmp/mypv.yaml

While running in an other terminal:

kubectl edit pv <mypv>

and remove the finalizer (which is preventing unattended deletions)

Finally you should restart the pod or for a large number of pvs restart the node(s)

useful!
source:https://uonfu.com/
Github User Rank List