<p>For each branch I deploy a review app on Kubernetes, consisting of, let's say, a web server, a PHP server and a database. As far as I understand it is convention to use separate deployments for those services and it allows me to prepare the database in an init container of the PHP deployment.</p>

<p>However, I now have a number of seemingly unrelated deployments, only "grouped" by their similar name:</p>

<pre><code>my-namespace
├── issue-foo-web
├── issue-foo-php
├── issue-foo-db
├── issue-bar-web
├── issue-bar-php
└── issue-bar-db
</code></pre>

<p>Is there a native/recommended way in Kubernetes to group deployments for one "app" or "installation" allowing for example to delete or health-check the whole group?</p>

<p>You should use Kubernetes labels to tag your resources. There are a number of <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/" rel="nofollow noreferrer">recommended labels</a> that you can use for this. </p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: mysql
    app.kubernetes.io/instance: wordpress-abcxzy
    app.kubernetes.io/version: "5.7.21"
    app.kubernetes.io/component: database
    app.kubernetes.io/part-of: wordpress
    app.kubernetes.io/managed-by: helm
</code></pre>
