<p>I try, I try, but Rancher 2.1 fails to deploy the &quot;<strong>mongo-replicaset</strong>&quot; Catalog App, with <strong>Local Persistent Volumes</strong> configured.</p>
<p>How to correctly deploy a mongo-replicaset with Local Storage Volume? Any debugging techniques appreciated since I am new to rancher 2.</p>
<p>I follow the 4 ABCD steps bellow, but the first pod deployment never ends. What's wrong in it? Logs and result screens are at the end. Detailed configuration can be found <a href="https://github.com/rancher/rancher/issues/16298" rel="nofollow noreferrer">here</a>.</p>
<p><strong>Note</strong>: Deployment without Local Persistent Volumes <strong>succeed</strong>.</p>
<p><strong>Note</strong>: Deployment with Local Persistent Volume and with the &quot;mongo&quot; image <strong>succeed</strong> (without replicaset version).</p>
<p><strong>Note</strong>: Deployment with both mongo-replicaset and with Local Persistent Volume <strong>fails</strong>.</p>
<hr />
<p><strong>Step A - Cluster</strong></p>
<p>Create a rancher instance, and:</p>
<ol>
<li>Add three nodes: a worker, a worker etcd, a worker control plane</li>
<li>Add a label on each node: name one, name two and name three for node Affinity</li>
</ol>
<hr />
<p><strong>Step B - Storage class</strong></p>
<p>Create a storage class with these parameters:</p>
<ol>
<li>volumeBindingMode : WaitForFirstConsumer <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/#local" rel="nofollow noreferrer">saw here</a></li>
<li>name : local-storage</li>
</ol>
<hr />
<p><strong>Step C - Persistent Volumes</strong></p>
<p>Add 3 persistent volumes like this:</p>
<ol>
<li>type : local node path</li>
<li>Access Mode: Single Node RW, 12Gi</li>
<li>storage class: local-storage</li>
<li>Node Affinity: name one (two for second volume, three for third volume)</li>
</ol>
<hr />
<p><strong>Step D - Mongo-replicaset Deployment</strong></p>
<p>From catalog, select Mongo-replicaset and configure it like that:</p>
<ol>
<li>replicaSetName: rs0</li>
<li>persistentVolume.enabled: true</li>
<li>persistentVolume.size: 12Gi</li>
<li>persistentVolume.storageClass: local-storage</li>
</ol>
<hr />
<p><strong>Result</strong></p>
<p>After doing ABCD steps, the newly created mongo-replicaset app stay infinitely in &quot;Initializing&quot; state.</p>
<p><img src="https://i.stack.imgur.com/JYW6H.png" alt="mongo status stopped at initialized" /></p>
<p>The associated mongo workload contain only one pod, instead of three. And this pod has two 'crashed' containers, bootstrap and mongo-replicaset.</p>
<p><img src="https://i.stack.imgur.com/lzu2j.png" alt="crashed workload with only one pod" /></p>
<hr />
<p><strong>Logs</strong></p>
<p>This is the output from the 4 containers of the only running pod. There is no error, no problem.</p>
<p><img src="https://i.stack.imgur.com/saijl.png" alt="no logs in mongo container" />
<img src="https://i.stack.imgur.com/awx7D.png" alt="allmost no logs in copy-config container" />
<img src="https://i.stack.imgur.com/2ojI6.png" alt="allmost no logs in install container" />
<img src="https://i.stack.imgur.com/Ea4le.png" alt="some logs from bootstrap container" /></p>
<p>I can't figure out what's wrong with this configuration, and I don't have  any tools or techniques to analyze the problem. Detailed configuration can be found <a href="https://github.com/rancher/rancher/issues/16298" rel="nofollow noreferrer">here</a>. Please ask me for more commands results.</p>
<p>Thanks you</p>

Slim
<p>All this configuration is correct.</p>

<p>It's missing a detail since Rancher is a containerized deployment of kubernetes.
Kubelets are deployed on each node in docker containers. They don't access to OS local folders.</p>

<p>It's needed to add a volume binding for the kubelets, like that K8s will be able to create the mongo pod with this same binding.</p>

<p>In rancher:
Edit the cluster yaml (Cluster > Edit > Edit as Yaml)</p>

<p>Add the following entry under "services" node:</p>

<pre><code>  kubelet: 
    extra_binds: 
      - "/mongo:/mongo:rshared"
</code></pre>
