<p>I am looking for some good examples about structuring namespaces in Kubernetes clusters, and an appropriate way to label my pods for long term maintainability.</p>

<p>Can you recommend some resources, or examples from real world applications that follow some solid practices?</p>

<p>Namespaces:</p>

<ul>
<li><p>I recommend grouping resources by namespaces for "resources you can just delete altogether".</p></li>
<li><p>Most notably, Kubernetes Policy objects (like RBAC, PodSecurityPolicy, NetworkPolicy, ResourceQuota) are per-namespace. So "namespaces" are often for organizational/team boundary.</p></li>
</ul>

<p>Labels:</p>

<ul>
<li>These can be applied to any kind of object (incl. namespaces)</li>
<li>Think of labels that indicate logical grouping of objects.</li>
<li>For example you can have an <code>app=paymentservice</code> label for everything that empowers this app (Pods, Service, Secret)</li>
<li>You can also use labels to indicate:

<ul>
<li>version/commit numbers: <code>gitcommit=235ab3f</code></li>
<li>purpose (especially useful while testing namespaces etc) <code>purpose=testing</code></li>
<li>organizational boundary (again, for namespaces) <code>team=payments</code></li>
</ul></li>
</ul>
