operator
operator copied to clipboard
vmalert doesn't take environment variables
TLDR: both "vmagent" and "vmalert" have externalLabels field. vmagent replaces environment variables placed as placeholder, vmalert passes them as-is
k describe pod vmoperator-55d697dcf9-pfk55
Image: victoriametrics/operator:v0.28.5
k exec vmalert-infra-86bd448b6-kcr9r -c vmalert env | grep BKS_CLUSTER
BKS_CLUSTER=bplatform-eu-uk-prod-d
k exec vmalert-infra-86bd448b6-kcr9r -c vmalert ps
/vmalert-prod -datasource.url=http://monitor -enableTCP6=true -envflag.enable=true -evaluationInterval=1m -external.label=cluster=%{BKS_CLUSTER}

apiVersion: operator.victoriametrics.com/v1beta1
kind: VMAlert
metadata:
name: infra
spec:
extraEnvs:
- name: BKS_CLUSTER
valueFrom:
configMapKeyRef:
name: bookings.puppet
key: cluster
externalLabels:
cluster: "%{BKS_CLUSTER}"
Must be fixed at the v1.82.0 + vmalert release, feel free to re-open.