How to move PV from one kubernetes node to another

Viewed 332

I have a k8s cluster which uses rancher.io/local-path. There is a PV there


    $ kubectl describe pv pvc-979af6ff-3617-4707-8a2c-b6c4ac00043f
    Name:              pvc-979af6ff-3617-4707-8a2c-b6c4ac00043f
    Labels:            <none>
    Annotations:       pv.kubernetes.io/provisioned-by: rancher.io/local-path
    Finalizers:        [kubernetes.io/pv-protection]
    StorageClass:      local-path
    Status:            Bound
    Claim:             gitlab/gitlab-prometheus-server
    Reclaim Policy:    Delete
    Access Modes:      RWO
    VolumeMode:        Filesystem
    Capacity:          8Gi
    Node Affinity:     
      Required Terms:  
        Term 0:        kubernetes.io/hostname in [agent-1]
    Message:           
    Source:
        Type:          HostPath (bare host directory volume)
        Path:          /var/lib/rancher/k3s/storage/pvc-979af6ff-3617-4707-8a2c-b6c4ac00043f_gitlab_gitlab-prometheus-server
        HostPathType:  DirectoryOrCreate
    Events:            <none>

I would like to move that PV to another node, agetn-5. How can I achieve that? Important point that PV in question is rancher.io/local-path provisioned.

0 Answers
Related