Kubernetes one pod per node, one persistent volume per pod

12/27/2019

I was curious if it is possible to move completely off hostpaths and use local volumes (persistent volumes) instead. However, there doesn't seem to be a way to include volumeClaimTemplates into a daemonset.

Statefulsets provide volumeClaimTemplates, but they require the replicas to be manually defined, as opposed to auto scaling to as many nodes as can be found.

Is there a way to automatically scale to all nodes, and also create a pvc per replica?

Related question where they decided to use statefulsets and give up autoscaling: Handling PersistentVolumeClaim in DaemonSet

-- kittydoor
daemonset
kubernetes
persistent-volume-claims
persistent-volumes

1 Answer

1/2/2020

There is no possibility for now to use PersistentVolumes in Daemon Set.

There was a feature request for it on Github but unfortunately it was closed. Link to this request: volumeClaimTemplates available for Daemon Sets

There is a comment in the link above which is describing this topic a bit more.

-- Dawid Kruk
Source: StackOverflow