Tested with 4.4.0-rc.0,and create PodMonitor in a user namespace, Prometheus can discover/register the target, example create PodMonitor under namespace load ******************** global: evaluation_interval: 30s scrape_interval: 30s external_labels: prometheus: openshift-user-workload-monitoring/user-workload prometheus_replica: prometheus-user-workload-0 rule_files: - /etc/prometheus/rules/prometheus-user-workload-rulefiles-0/*.yaml scrape_configs: - job_name: load/prometheus-example-app/0 honor_labels: false honor_timestamps: false kubernetes_sd_configs: - role: pod namespaces: names: - load scrape_interval: 30s relabel_configs: - action: keep source_labels: - __meta_kubernetes_pod_label_app regex: prometheus-example-app - action: keep source_labels: - __meta_kubernetes_pod_container_port_name regex: web - source_labels: - __meta_kubernetes_namespace target_label: namespace - source_labels: - __meta_kubernetes_pod_container_name target_label: container - source_labels: - __meta_kubernetes_pod_name target_label: pod - target_label: job replacement: load/prometheus-example-app - target_label: endpoint replacement: web - target_label: namespace replacement: load alerting: alert_relabel_configs: - action: labeldrop regex: prometheus_replica alertmanagers: - path_prefix: / scheme: https tls_config: insecure_skip_verify: false ca_file: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt server_name: alertmanager-main.openshift-monitoring.svc kubernetes_sd_configs: - role: endpoints namespaces: names: - openshift-monitoring bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token api_version: v2 relabel_configs: - action: keep source_labels: - __meta_kubernetes_service_name regex: alertmanager-main - action: keep source_labels: - __meta_kubernetes_endpoint_port_name regex: web **************************
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:0581