appuio / component-appuio-cloud

APPUiO Cloud
https://hub.syn.tools/appuio-cloud/index.html
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Add alert for unlabelled tenant namespaces #162

Open simu opened 1 year ago

simu commented 1 year ago

Context

We currently deploy the following alerting rule through the hierarchy:

parameters:
  openshift4_monitoring:
    rules:
      appuio-cloud:
        alert:UnlabelledTenantNamespace:
          expr: 'sum by (namespace) (kube_namespace_labels{namespace!~"default|cilium|syn.*|openshift.*|appuio-.*|kube-.*",label_appuio_io_organization=""}) > 0'
          for: "1m"
          annotations:
            message: |-
              Tenant namespace {{ $labels.namespace }} doesn't have the `appuio.io/organization` label.

Note that the namespace regex matches the list of reserved namespaces in the component defaults. We should configure this alerting rules through the component, and exclude namespaces based on the contents of parameter reservedNamespaces, cf. https://github.com/appuio/component-appuio-cloud/blob/428ed1d6fa51f54525ab6abaf5faf09145078b6b/class/defaults.yml#L138-L143

Alternatives

Keep the config in the hiearchy