prometheus-operator: prometheus-operator 0.33,ruleNamespaceSelector is not working

What happened? prometheus-operator 0.33,ruleNamespaceSelector is not working Did you expect to see some different? when i create prometheusrule in other namespace,the prometheus operator can find it How to reproduce it (as minimally and precisely as possible): i create a prometheusrule at kube-system namespace,but therer is nothing in prometheus’s UI Environment

  • Prometheus Operator version: prometheus-operator 0.33 Insert image tag or Git SHA here

  • Kubernetes version information: Server Version: version.Info{Major:“1”, Minor:“10”, GitVersion:“v1.10.0”, GitCommit:“fc32d2f3698e36b93322a3465f63a14e9f0eaead”, GitTreeState:“clean”, BuildDate:“2018-03-26T16:44:10Z”, GoVersion:“go1.9.3”, Compiler:“gc”, Platform:“linux/amd64”} kubectl version 1.10

  • Kubernetes cluster kind:

    kubeadm

  • Manifests:

apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
  labels:
    prometheus: janus
  name: janus
  namespace: monitoring
spec:
  alerting:
    alertmanagers:
    - name: alertmanager
      namespace: monitoring
      port: alert
  retention: 300d
  storage:
    volumeClaimTemplate:
      spec:
        storageClassName: local-storage
        resources:
          requests:
            storage: 90Gi
  baseImage: quay.io/prometheus/prometheus
  nodeSelector:
    prometheus: deployed
  podMonitorSelector: {}
  replicas: 2
  ruleSelector: {}
  ruleNamespaceSelector: 
    matchLabels:
      namespace: kube-system
  securityContext:
    fsGroup: 2000
    runAsNonRoot: true
    runAsUser: 1000
  additionalScrapeConfigs:
    name: additional-configs
    key: prometheus-additional.yaml
  serviceAccountName: prometheus-k8s
  serviceMonitorNamespaceSelector: {}
  serviceMonitorSelector: {}
  version: v2.11.0

  • Prometheus Operator Logs:
level=info ts=2019-11-29T00:10:46.984367341Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T00:13:46.973647144Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T00:16:46.44537077Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T00:19:47.140513326Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T00:22:49.756379862Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T00:25:47.030447614Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T00:28:46.751344447Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T00:31:46.643626445Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T00:34:47.158656178Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T00:37:47.109882047Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T00:40:47.162427809Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T00:43:47.351519659Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T00:46:46.842565308Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T00:49:46.834624258Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T00:52:47.015767322Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T00:55:46.633987853Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T00:58:46.806089565Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T01:01:46.462754207Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T01:04:46.425956854Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T01:07:46.874226277Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T01:10:46.91100777Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T01:13:46.496781191Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T01:15:38.431800191Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T01:15:38.456870759Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus
level=info ts=2019-11-29T01:15:38.468594256Z caller=operator.go:1056 component=prometheusoperator msg="sync prometheus" key=monitoring/janus

Anything else we need to know?:

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 26 (10 by maintainers)

Most upvoted comments

More information for people who want to ignore labels and just have monitoring and rules for all namespaces / objects, it’s important to set the following:

    prometheus:
      prometheusSpec:
        ruleSelector: {}
        ruleNamespaceSelector: {}
        ruleSelectorNilUsesHelmValues: false
        serviceMonitorSelector: {}
        serviceMonitorNamespaceSelector: {}
        serviceMonitorSelectorNilUsesHelmValues: false
        podMonitorSelector: {}
        podMonitorNamespaceSelector: {}
        podMonitorSelectorNilUsesHelmValues: false