github.com/caos/orbos@v1.5.14-0.20221103111702-e6cd0cea7ad4/docs/boom/labels.md (about)

     1  # Labels with BOOM
     2  
     3  Different labels are used in the BOOM context to differentiate resources which are managed by BOOM.
     4  
     5  ## Applications
     6  
     7  All resources of the applications deployed by BOOM have several BOOM-specific labels to identify them as managed by BOOM:
     8  - app.kubernetes.io/managed-by: boom.caos.ch
     9  - boom.caos.ch/part-of: boom
    10  - boom.caos.ch/instance: \*instanceName\*
    11  - boom.caos.ch/application: \*application\* 
    12  
    13  As example for ambassador:
    14  ```yaml
    15  apiVersion: apps/v1
    16  kind: Deployment
    17  metadata:
    18    labels:
    19      app.kubernetes.io/instance: ambassador
    20      app.kubernetes.io/managed-by: boom.caos.ch
    21      app.kubernetes.io/name: ambassador
    22      app.kubernetes.io/part-of: ambassador
    23      boom.caos.ch/application: ambassador
    24      boom.caos.ch/instance: boom
    25      boom.caos.ch/part-of: boom
    26    name: ambassador
    27    namespace: caos-system
    28  spec:
    29  ```
    30  
    31  It is important to note that only the resources directly applied from BOOM will get the labels, 
    32  as the resulting pods from the deployments are irrelevant to compare the desired and the current state. 
    33  Because the pods will get created through the replica-sets which are created through Kubernetes from the deployments.
    34  
    35  If any other resources have this labels and they are not desired, BOOM will delete the resources without asking,
    36  as this is part of reconciling the toolset.
    37  
    38  ## ServiceMonitors, PodMonitors and PrometheusRules
    39  
    40  The CRD-definitions for Prometheus have their own labels which define if they are included.
    41  
    42  Labels that the CRD will be included in the caos-Prometheus-instance:
    43  - boom.caos.ch/prometheus: \*prometheus-instance\*
    44  
    45  As example the ServiceMonitor for ambassador:
    46  ```yaml
    47  apiVersion: monitoring.coreos.com/v1
    48  kind: ServiceMonitor
    49  metadata:
    50    labels:
    51      app.kubernetes.io/managed-by: boom.caos.ch
    52      boom.caos.ch/application: prometheus
    53      boom.caos.ch/instance: boom
    54      boom.caos.ch/part-of: boom
    55      boom.caos.ch/prometheus: caos
    56    name: ambassador-servicemonitor
    57    namespace: caos-system
    58  ```
    59