<p>Imagine, I had a private image registry <strong>myregistry.corp</strong> with several (sub-) repositories e.g. <strong>project1.myregistry.corp</strong> and <strong>project2.myregistry.corp</strong>.</p>
<p>If I want to have one common imagePullingSecret, do I need to specify each of them in its dockerconfigjson or is Kubernetes smart enough to find the &quot;closest&quot; specified top level domain for a given domain (e.g. if I want to pull from project1.myregistry.corp/myapp)?</p>
<pre><code>{
  &quot;auths&quot;: {
    &quot;myregistry.corp&quot;: {
      &quot;username&quot;: &quot;my-user&quot;,
      &quot;password&quot;: &quot;blabla&quot;,
      &quot;auth&quot;: &quot;blabla&quot;
    }
  }
}
</code></pre>
<p>vs.</p>
<pre><code>{
  &quot;auths&quot;: {
    &quot;myregistry.corp&quot;: {
      &quot;username&quot;: &quot;my-user&quot;,
      &quot;password&quot;: &quot;blabla&quot;,
      &quot;auth&quot;: &quot;blabla&quot;
    },
    &quot;project1.myregistry.corp&quot;: {
      &quot;username&quot;: &quot;my-user&quot;,
      &quot;password&quot;: &quot;blabla&quot;,
      &quot;auth&quot;: &quot;blabla&quot;
    },
    &quot;project2.myregistry.corp&quot;: {
      &quot;username&quot;: &quot;my-user&quot;,
      &quot;password&quot;: &quot;blabla&quot;,
      &quot;auth&quot;: &quot;blabla&quot;
    }
  }
}
</code></pre>

Jalibu
<p>Based on <a href="https://kubernetes.io/docs/concepts/containers/images/#config-json" rel="nofollow noreferrer">Kubernetes documentation</a>:</p>
<blockquote>
<p>Kubernetes allows glob URLs as well as prefix-matched paths.</p>
</blockquote>
<p>For example, for your use case, the following should be possible:</p>
<pre class="lang-json prettyprint-override"><code>{
  &quot;auths&quot;: {
    &quot;*myregistry.corp&quot;: {
      &quot;username&quot;: &quot;my-user&quot;,
      &quot;password&quot;: &quot;blabla&quot;,
      &quot;auth&quot;: &quot;blabla&quot;
    }
  }
}
</code></pre>
