Skip to content

Have longhorn ServiceMonitor be deployed only when monitoring (CRD) unit is enabled

Bogdan-Adrian Burciu requested to merge bb/fix-issue1343 into main

What does this MR do and why?

In !2420 (diffs) the Longhorn chart received values:

        metrics:
          serviceMonitor:
            enabled: true

but it can happen that monitoring-crd (its crd-servicemonitors.yaml) unit is:

  • not deployed at all if monitoring unit is not enabled, like we advertise for non-CI libvirt-metal deployments
units:
  monitoring:
    enabled_conditions:
      - '{{ ternary true false (.Values.env_type | eq "ci") | include "preserve-type" }}'

(https://gitlab.com/sylva-projects/sylva-core/-/blob/1.1.0/environment-values/rke2-capm3-virt/values.yaml#L111-113)

  • does not deploy the needed CRD before longhorn HelmRelease is deployed

This change tries to fix those conditions.

Related reference(s)

Closes #1343 (closed)

Test coverage

Edited by Bogdan-Adrian Burciu

Merge request reports