<p>I am new to kubernetes can somebody please explain why there are multiple volume types like</p>

<ul>
<li>configMap</li>
<li>emptyDir</li>
<li>projected</li>
<li>secret</li>
<li>downwardAPI</li>
<li>persistentVolumeClaim</li>
</ul>

<p>For few I am able to figure out, like why we need secret instead of configmap.
For rest I am not able to understand the need for others.</p>

prashant
<p>Your question is too generic to answer, here are the few comments off the top of my head</p>

<p>If the deployed <strong>pod or containers</strong> wants to have configuration data then you need to use <strong>configMap resource</strong>, if there are secrets or passwords its obvious to use <strong>secret resource</strong>.</p>

<p>Now if the deployed pods wants to use POD_NAME which is generated during schedule or Run time, then it need to use <strong>DownwardAPI resources</strong>.    </p>

<p>Emptydir share the lifecycle with the <strong>Deployed pod</strong>, If the pods dies then all of the data which are stored using emptydir resource will be gone, now If you want to persist the data then you need to use <strong>persistentVolume, persistentVolumeClaim and storageclass Resources</strong>. </p>

<p>for further information <a href="https://kubernetes.io/docs/concepts/storage/volumes/" rel="nofollow noreferrer">k8s volumes</a></p>
