<p>Lets say I have a pod with one volume created from a secret, which comes to life in ~5sec.</p>
<p>Now if I create a bigger amounts of pods and secrets everything getting slower. Which is kind of normal I guess.</p>
<p>Lets say I create 20pod with 500secret. It takes ~150sec to get into running state.
I get a ton of warning like:</p>
<pre><code>Warning  FailedMount  45s (x1 over 1m)   kubelet  Unable to attach or mount volumes: unmounted volumes=[abc-secrets-vol], unattached volumes=[abc-secrets-vol default-token-cp4nw nginx-config]: timed out waiting for the condition
</code></pre>
<p>But nothing serious , by the end everything will work fine.</p>
<p>Now the questions:<br></p>
<ul>
<li>Is there any cluster level settings which can speed things up?</li>
<li>Which part of the K8s responsible for this?</li>
<li>Which part is slow in this case? <code>volume creation</code> OR <code>volume attach</code> (I excluded the secret creation because they got created pretty fast) ?</li>
</ul>

beatrice
<p>The kubelet handles this. There is no reason for anyone to have load-tested such a weird edge case because why would you ever do that? The slowdown is likely the Kubelet getting access to all the data because that has to wait for the scheduler (because of NodeRestriction) and then it might be hitting a client-side rate limit or APF rate limit after that? Honestly not sure, again we don't load test every ludicrous scenario because there are an unlimited number of those :) Nor do we put in options to control them without good reason.</p>
