<p>I want deploy a mongodb chart using helm on my local dev environment.
I found all the possibile values on bitnami, but is overwhelming!
How can i configure something like that:</p>
<pre><code>template:
metadata:
  labels:
    app: mongodb
spec:
  containers:
  - name: mongodb
    image: mongo
    ports:
    - containerPort: 27017
    volumeMounts:
    - name: mongo-data
      mountPath: /data/db/
  volumes:
    - name: mongo-data
      hostPath:
        path: /app/db
</code></pre>
<p>Using value.yml configuration file?</p>

kri-dev
<p>The best approach here is to deploy something like the <a href="https://github.com/bitnami/charts/tree/master/bitnami/mongodb" rel="nofollow noreferrer">Bitnami MongoDB chart</a> that you reference in the question with its default options</p>
<pre class="lang-bash prettyprint-override"><code>helm install mongodb bitnami/mongodb
</code></pre>
<p>The chart will create a PersistentVolumeClaim for you, and a standard piece of Kubernetes called the <em>persistent volume provisioner</em> will create the corresponding PersistentVolume.  The actual storage will be &quot;somewhere inside Kubernetes&quot;, but for database storage there's little you can do with the actual files directly, so this isn't usually a practical problem.</p>
<p>If you can't use this approach, then you need to manually create the storage and then tell the chart to use it.  You need to create a pair of a PersistentVolumeClaim and a PersistentVolume, for example as shown in the start of <a href="https://stackoverflow.com/questions/51286231/kubernetes-persistent-volume-and-hostpath">Kubernetes Persistent Volume and hostpath</a>, and manually submit these using <code>kubectl apply -f pv-pvc.yaml</code>.  You then need to tell the Bitnami chart about that PersistentVolume:</p>
<pre class="lang-bash prettyprint-override"><code>helm install mongodb bitnami/mongodb \
  --set persistence.existingClaim=your-pvc-name
</code></pre>
<p>I'd avoid this sequence in a non-development environment.  The cluster should normally have a persistent volume provisioner set up and so you shouldn't need to manually create PersistentVolumes, and host-path volumes are unreliable in multi-node environments (they refer to a fixed path on whichever node the pod happens to be running on, so data can get misplaced if a pod is rescheduled on a different node).</p>
