VictoriaMetrics / operator

Kubernetes operator for Victoria Metrics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

alertmanager templates error

KKulishov opened this issue · comments

Hi! I have operator to v 0.39.3

image: victoriametrics/operator:v0.39.3

I'm trying to use the example from the documentation

apiVersion: operator.victoriametrics.com/v1beta1
kind: VMAlertmanager
metadata:
  name: example-alertmanager
  namespace: monitoring
spec:
  replicaCount: 2
  templates:
    - Name: alertmanager-templates
      Key: my-template-1.tmpl
    - Name: alertmanager-templates
      Key: my-template-2.tmpl
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: alertmanager-templates
  namespace: monitoring
data:
    my-template-1.tmpl: |
        {{ define "hello" -}}
        hello, Victoria!
        {{- end }}
    my-template-2.tmpl: """

and I get an error

error: error validating "test.yaml": error validating data: [ValidationError(VMAlertmanager.spec.templates[0]): unknown field "Key" in com.victoriametrics.operator.v1beta1.VMAlertmanager.spec.templates, ValidationError(VMAlertmanager.spec.templates[0]): unknown field "Name" in com.victoriametrics.operator.v1beta1.VMAlertmanager.spec.templates, ValidationError(VMAlertmanager.spec.templates[0]): missing required field "key" in com.victoriametrics.operator.v1beta1.VMAlertmanager.spec.templates, ValidationError(VMAlertmanager.spec.templates[1]): unknown field "Key" in com.victoriametrics.operator.v1beta1.VMAlertmanager.spec.templates, ValidationError(VMAlertmanager.spec.templates[1]): unknown field "Name" in com.victoriametrics.operator.v1beta1.VMAlertmanager.spec.templates, ValidationError(VMAlertmanager.spec.templates[1]): missing required field "key" in com.victoriametrics.operator.v1beta1.VMAlertmanager.spec.templates]; if you choose to ignore these errors, turn validation off with --validate=false

Can you tell me what the problem might be?

Hello, an issue with capital letters at Key and Name fields. Thanks for reporting, we'll fix examples.

apiVersion: operator.victoriametrics.com/v1beta1
kind: VMAlertmanager
metadata:
  name: example-alertmanager
  namespace: monitoring
spec:
  replicaCount: 2
  templates:
    - name: alertmanager-templates
      key: my-template-1.tmpl
    - name: alertmanager-templates
      key: my-template-2.tmpl
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: alertmanager-templates
  namespace: monitoring
data:
    my-template-1.tmpl: |
        {{ define "hello" -}}
        hello, Victoria!
        {{- end }}
    my-template-2.tmpl: """

Thank you!