Search code examples
kubernetesmicroservicespersistent-volumes

hostPath PV with RWO access mode for sharing between multiple pods


Is it possible to share a hostPath PV between multiple PODs (in multiple deployments) with RWO access mode provided both deployments are on same host as the PV is created for?

This is all under same project/namespace.


Solution

  • Yes. First you need to create claim using PVC. Remember there is one to one mapping between PV and PVC. Once you create PVC, you can use it for multiple pods of different deployment within same namespace as PVC is namespaced object in k8.

    Please refer this, https://docs.okd.io/latest/install_config/storage_examples/shared_storage.html