operator icon indicating copy to clipboard operation
operator copied to clipboard

PrometheusRule deletion doesn't cause VMRule deletion

Open flokli opened this issue 3 years ago • 2 comments

I'm using PrometheusRule CRs to describe alerts, and victoria-metrics-operator created shadow-VMRule CRs before configuring a vmalert pod with it.

While this seems to mostly work, it seems the operator doesn't delete the VMRule CR if the PrometheusRule gets deleted.

So if someone uses PrometheusRules exclusively, delete alerts stay persisted in the vmalert config, until someone manually removes the VMRule CRs.

Can victoria-metrics-operator also delete VMRule CRs if the PrometheusRule CRs get deleted?

flokli avatar May 30 '22 07:05 flokli

It should be possible with env variable for operator:

VM_ENABLEDPROMETHEUSCONVERTEROWNERREFERENCES=true

In this case, operator creates ownerReference for each converted object and it will be removed with original CR.

f41gh7 avatar May 30 '22 17:05 f41gh7

Indeed! This is acessible by setting operator.enable_converter_ownership to true in the helm chart. I wonder why it's not the default though? :thinking:

flokli avatar May 31 '22 10:05 flokli