Skip to content

VMAlert notifier TLS CA file is not added to args when notifier is configured via selector #1530

Description

@zg1r

When VMAlert.spec.notifiers is configured via selector, the generated vmalert Deployment does not include the notifier TLS CA file argument (-notifier.tlsCAFile=... / corresponding CA file flag).

What steps did you take and what happened?

Configured VMAlert.spec.notifiers using selector together with TLS configuration:

notifiers:
  - selector:
      labelSelector:
        matchLabels:
          app.kubernetes.io/instance: vmalertmanager
      namespaceSelector:
        matchNames:
          - namespace-alertmanager
    tlsConfig:
      ca:
        configMap:
          name: ca
          key: ca.crt

Matching VMAlertmanager resources exist in the selected namespace.
After reconciliation, generated vmalert Deployment contain args:
-notifier.url=..., but does not contain any notifier TLS CA argument (e.g. -notifier.tlsCAFile=...).

Because of this, notifier discovery via selector does not work and vmalert cannot send alerts to Alertmanager endpoints that require custom CA trust.

What did you expect to happen?
###Operator should:

  • correctly resolve notifier URLs using selector
  • render -notifier.url=
  • mount provided CA configMap
  • add notifier TLS CA argument (e.g. -notifier.tlsCAFile=)

Is there anything else you would like to add?

The issue only reproduces when notifier is configured via selector.

When the notifier is configured with an explicit url, TLS configuration behaves differently and the generated vmalert Deployment does include the notifier TLS CA file argument (-notifier.tlsCAFile=...).

It looks like operator generates an empty notifier argument instead of failing reconciliation or reporting an error.

This makes it difficult to use VMAlert.spec.notifiers[].selector together with TLS-protected Alertmanager endpoints.

Please tell us about your environment.

Value How to Obtain
Kubernetes version v1.30.4 kubectl version
VM Operator version v0.60.0
kubectl -n beget-vm-operator get pods \
  -ojsonpath='{range .items[*].spec.containers[*]}{.image}{"\n"}{end}' | \
  sort -u

quay.io/brancz/kube-rbac-proxy:v0.21.0
victoriametrics/operator:v0.60.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions