How to change all volume types from hostPath to nfs in kubernetes?

11/5/2021

Currently, my cluster uses hostPath as the volume type. I want to change all volume types from hostPath to nfs and create pvc for every volume. How can I do this without losing data?

Information:
Kubernetes version: 1.22.2
Installation method: bare-metal
Host OS: Ubuntu 20.04
CNI and version: Flannel 0.15.0
CRI and version: Docker 20.10.9
-- Aterow
kubernetes
nfs

0 Answers