<p>I have provisioned manually a few small local storage PVs for a redis stateful set (I have provisioned 10 on a 3 node cluster)</p>

<p>They seem to to be working fine. The pods created by the redis stateful set got their volume claim templates fulfilled.</p>

<p>I am however curios, on which nodes each pv is hosted on</p>

<p>When I use <code>kubectl get pv</code>, I get the following output:</p>

<pre><code>NAME             CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS        CLAIM                          STORAGECLASS    REASON   AGE
small-volume-1   1Gi        RWO            Retain           Available                                    local-storage            51d
small-volume-2   1Gi        RWO            Retain           Bound         default/data-redis-cluster-3   local-storage            51d
small-volume-3   1Gi        RWO            Retain           Terminating   default/data-redis-cluster-1   local-storage            51d
small-volume-4   1Gi        RWO            Retain           Bound         default/data-redis-cluster-2   local-storage            51d
small-volume-5   1Gi        RWO            Retain           Bound         default/data-redis-cluster-5   local-storage            51d
small-volume-6   1Gi        RWO            Retain           Terminating   default/data-redis-cluster-0   local-storage            51d
small-volume-7   1Gi        RWO            Retain           Available                                    local-storage            51d
small-volume-8   1Gi        RWO            Retain           Bound         default/data-redis-cluster-4   local-storage            51d
small-volume-9   1Gi        RWO            Retain           Available                                    local-storage            51d
</code></pre>

<p>When I do <code>kubectl describe</code> on any of the PVs, I still don't see on which node it's on.</p>

<p>Is there a way to tell? (providing that I don't force them to be created on a specific node using node affinity)</p>

CC BY-SA 4.0
2019-01-31T17:26:14.033Z
According to https://kubernetes.io/blog/2018/04/13/local-persistent-volumes-beta/ you have to set the node when you create the PV. 

Could you run `kubectl get pv --export=true -o yaml` that should dump the yaml config which will have...

`
nodeAffinity:
    required:
      nodeSelectorTerms:
`
which tells you the node that volume is on.

Also when you run describe pv, do you get `Node Affinity:   <none>` ? I do but my PV's are not `local-storage`
Levi
CC BY-SA 4.0
2019-12-24T18:50:54.027Z
Could you reply to the comment?
030
<kubernetes><kubernetes-volume>
How to tell on which node a local storage PV has been created on k8s?
Tom Klino
# How to tell on which node a local storage PV has been created on k8s?

(Asked by: username_0 on 2019-01-31)

I have provisioned manually a few small local storage PVs for a redis stateful set (I have provisioned 10 on a 3 node cluster)
They seem to to be working fine. The pods created by the redis stateful set got their volume claim templates fulfilled.
I am however curios, on which nodes each pv is hosted on
When I use kubectl get pv, I get the following output:
NAME             CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS        CLAIM                          STORAGECLASS    REASON   AGE
small-volume-1   1Gi        RWO            Retain           Available                                    local-storage            51d
small-volume-2   1Gi        RWO            Retain           Bound         default/data-redis-cluster-3   local-storage            51d
small-volume-3   1Gi        RWO            Retain           Terminating   default/data-redis-cluster-1   local-storage            51d
small-volume-4   1Gi        RWO            Retain           Bound         default/data-redis-cluster-2   local-storage            51d
small-volume-5   1Gi        RWO            Retain           Bound         default/data-redis-cluster-5   local-storage            51d
small-volume-6   1Gi        RWO            Retain           Terminating   default/data-redis-cluster-0   local-storage            51d
small-volume-7   1Gi        RWO            Retain           Available                                    local-storage            51d
small-volume-8   1Gi        RWO            Retain           Bound         default/data-redis-cluster-4   local-storage            51d
small-volume-9   1Gi        RWO            Retain           Available                                    local-storage            51d

When I do kubectl describe on any of the PVs, I still don't see on which node it's on.
Is there a way to tell? (providing that I don't force them to be created on a specific node using node affinity)

**Tags:** kubernetes, kubernetes-volume

> **Comments:**
> **username_1**: According to https://kubernetes.io/blog/2018/04/13/local-persistent-volumes-beta/ you have to set the node when you create the PV.   Could you run `kubectl get pv --export=true -o yaml` that should dump the yaml config which will have...  ` nodeAffinity:     required:       nodeSelectorTerms: ` which tells you the node that volume is on.  Also when you run describe pv, do you get `Node Affinity:   <none>` ? I do but my PV's are not `local-storage`  
> **username_2**: Could you reply to the comment?  

---

## 0 answers

