A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/prometheus-operator/prometheus-operator/issues/7214 below:

PodMonitor matchExpression selector broken after 0.79 · Issue #7214 · prometheus-operator/prometheus-operator · GitHub

Is there an existing issue for this? What happened? Description

Version 0.79.0 breaks podmonitors using the DoesNotExist matchExpression.

Steps to Reproduce

Create a pod monitor:

apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: test-podmonitor
spec:
  jobLabel: test-stats
  namespaceSelector:
    any: true
  podMetricsEndpoints:
  - interval: 30s
    path: /metrics
  selector:
    matchExpressions:
    - key: any-key
      operator: DoesNotExist

Then run kubectl describe podmonitor test-podmonitor

Expected Result

nothing, it should be a valid podmonitor

Actual Result

The events show:

  Warning  InvalidConfiguration  15s   prometheus-controller  PodMonitor test-podmonitor was rejected due to invalid configuration: failed to create label requirement: operator: Unsupported value: "doesnotexist": supported values: "in", "notin", "=", "==", "!=", "gt", "lt", "exists", "!"
Prometheus Operator Version
quay.io/prometheus-operator/prometheus-operator:v0.79.1
Kubernetes Version
clientVersion:
  buildDate: "2024-03-14T23:58:34Z"
  compiler: gc
  gitCommit: 6813625b7cd706db5bc7388921be03071e1a492d
  gitTreeState: clean
  gitVersion: v1.29.3
  goVersion: go1.21.8
  major: "1"
  minor: "29"
  platform: darwin/arm64
kustomizeVersion: v5.0.4-0.20230601165947-6ce0bf390ce3
serverVersion:
  buildDate: "2024-10-23T23:40:34Z"
  compiler: gc
  gitCommit: d06fe5fa1c524ee5eb5d16bb9edc4dda6075f6c3
  gitTreeState: clean
  gitVersion: v1.29.10-eks-7f9249a
  goVersion: go1.22.8
  major: "1"
  minor: 29+
  platform: linux/amd64
Kubernetes Cluster Type

EKS

How did you deploy Prometheus-Operator?

helm chart:prometheus-community/kube-prometheus-stack

Manifests
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: envoy-stats-monitor
  namespace: istio-system
  labels:
    monitoring: istio-proxies
    release: istio
spec:
  selector:
    matchExpressions:
    - {key: istio-prometheus-ignore, operator: DoesNotExist}
  namespaceSelector:
    any: true
  jobLabel: envoy-stats
  podMetricsEndpoints:
  - path: /stats/prometheus
    interval: 15s
    relabelings:
    - action: keep
      sourceLabels: [__meta_kubernetes_pod_container_name]
      regex: "istio-proxy"
    - action: keep
      sourceLabels: [__meta_kubernetes_pod_annotationpresent_prometheus_io_scrape]
    - sourceLabels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
      action: replace
      regex: ([^:]+)(?::\d+)?;(\d+)
      replacement: $1:$2
      targetLabel: __address__
    - action: labeldrop
      regex: "__meta_kubernetes_pod_label_(.+)"
    - sourceLabels: [__meta_kubernetes_namespace]
      action: replace
      targetLabel: namespace
    - sourceLabels: [__meta_kubernetes_pod_name]
      action: replace
      targetLabel: pod_name
prometheus-operator log output
ts=2024-12-17T21:08:11.783532321Z level=warn caller=/workspace/pkg/prometheus/resource_selector.go:460 msg="skipping podmonitor" component=prometheus-controller error="failed to create label requirement: operator: Unsupported value: \"doesnotexist\": supported values: \"in\", \"notin\", \"=\", \"==\", \"!=\", \"gt\", \"lt\", \"exists\", \"!\"" podmonitor=istio-system/envoy-stats-monitor namespace=lighthouse prometheus=kube-prometheus-stack-prometheus
ts=2024-12-17T21:08:11.82246845Z level=info caller=/go/pkg/mod/k8s.io/client-go@v0.32.0/tools/record/event.go:389 msg="Event occurred" object.name=envoy-stats-monitor object.namespace=istio-system fieldPath="" kind=PodMonitor apiVersion=monitoring.coreos.com/v1 type=Warning reason=InvalidConfiguration message="PodMonitor envoy-stats-monitor was rejected due to invalid configuration: failed to create label requirement: operator: Unsupported value: \"doesnotexist\": supported values: \"in\", \"notin\", \"=\", \"==\", \"!=\", \"gt\", \"lt\", \"exists\", \"!\""
Anything else?

The full monitor spec is defined here https://github.com/istio/istio/blob/0c4570a10cb012a6f63796dcc6ec72d83599f1c7/samples/addons/extras/prometheus-operator.yaml

ptr1120, jlemaes and iteplov


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4