Skip to content

ServiceMonitor misconfiguration #357

@VLZZZ

Description

@VLZZZ

Hi!
I've just found that litmus ServiceMonitor for metrics collection seems to be misconfigured
I deep dived a bit and it looks like ServiceMonitor selector:

spec:
  endpoints:
  - path: /metrics
    port: http
  namespaceSelector:
    matchNames:
    - litmus
  selector:
    matchLabels:
      app: litmus
      app.kubernetes.io/instance: litmus-chaos
      app.kubernetes.io/name: litmus

which is resulted in litmus-monitor service (kubernetes service entity).
That has a Pod selector:

  ports:
  - name: http
    port: 8080
    protocol: TCP
    targetPort: http
  selector:
    app: litmus
    app.kubernetes.io/instance: litmus-chaos
    app.kubernetes.io/name: litmus

But this selector covers both litmus and litmus-monitor pods.

But only litmus-monitor-* has port named http at 8080 and serves prometheus metrics
While litmus-* pod has http at 80 with no prometheus metrics. (litmus pods can server default go metrics at 8080 but it's a different story and I don't think that we need this)

    name: chaos-operator
    ports:
    - containerPort: 80
      name: http
      protocol: TCP

I believe we need to narrow selector to match litmus-monitor only.

Or to allow additionalLables for the selector

  1. https://github.com/litmuschaos/litmus-helm/blob/31a0a30a370c64de6227bfb0ff10035c4b[…]dcd8c/charts/litmus-core/templates/exporter-servicemonitor.yaml
  2. {{- define "litmus.selectors" }}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions