<p>I use nfs-client-provisioner inside my kubernetes cluster.</p>

<p>But, the name of the PersistentVolume is random.</p>

<p>cf. doc:
<a href="https://github.com/rimusz/nfs-client-provisioner" rel="nofollow noreferrer">nfs-client-provisioner</a></p>

<blockquote>
  <p>--> Persistent volumes are provisioned as ${namespace}-${pvcName}-${pvName}</p>
</blockquote>

<p>But, where could i change the value of pvName ??  </p>

<p>Actually, it's random, for exemple : pvName = pvc-2v82c574-5bvb-491a-bdfe-061230aedd5f</p>

<p>This is the naming convention of directories corresponding to the <code>PV</code> names but stored on share of NFS server</p>

<p>If it comes to <code>PV</code> name provisioned dynamically by <code>nfs-provisioner</code> it follow the following naming convention:</p>

<p><code>pvc-</code> + <code>claim.UID</code></p>

<p>Background information:</p>

<p>According to the design proposal of external storage provisioners (NFS-client belongs to this category), you must not declare <code>volumeName</code> explicitly in <a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/volume-provisioning.md" rel="nofollow noreferrer">PVC spec</a>.</p>

<blockquote>
  <p>#  volumeName: must be empty!</p>
</blockquote>

<p><code>pv.Name</code> <strong>MUST</strong> be unique. Internal provisioners use name based on <code>claim.UID</code> to produce conflicts when two provisioners accidentally provision a <code>PV</code> for the same claim, however external provisioners can use any mechanism to generate an unique <code>PV</code> name.</p>

<p>In case of <code>nfs-client</code> provisioner, the <code>pv.Name</code> generation is handled by the <code>controller</code> library, and it gets following format:</p>

<p><code>pvc-</code> + <code>claim.UID</code></p>

<p><a href="https://github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/blob/c525773885fccef89a1edd22bb3f813d50548ed1/controller/controller.go#L1414" rel="nofollow noreferrer">Source</a></p>

<p>I hope it helps.</p>
