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:

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)

  • According to 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 Jan 31 at 17:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.