Bug 1704573

Summary: prometheus-k8s serviceaccount cannot list endpoints in the namespace openshift-etcd
Product: OpenShift Container Platform Reporter: Junqi Zhao <juzhao>
Component: MonitoringAssignee: Frederic Branczyk <fbranczy>
Status: CLOSED ERRATA QA Contact: Peter Ruan <pruan>
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: anpicker, erooth, mifiedle, mloibl, pkrupa, pruan, surbania
Target Milestone: ---Keywords: Regression, TestBlocker
Target Release: 4.1.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-04 10:48:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Description Flags
prometheus-k8s pod logs
prometheus-k8s sa info none

Description Junqi Zhao 2019-04-30 05:49:13 UTC
Created attachment 1560175 [details]
prometheus-k8s pod logs

Description of problem:
etcd pods/services are moved to openshift-etcd project now, but the etcd svc can not be discovered and can not show etcd data in grafana UI

error in prometheus-k8s pod logs shows:
level=error ts=2019-04-30T04:06:58.311Z caller=klog.go:94 component=k8s_client_runtime func=ErrorDepth msg="github.com/prometheus/prometheus/discovery/kubernetes/kubernetes.go:300: Failed to list *v1.Endpoints: endpoints is forbidden: User \"system:serviceaccount:openshift-monitoring:prometheus-k8s\" cannot list resource \"endpoints\" in API group \"\" in the namespace \"openshift-etcd\""

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Check etcd targets in prometheus /service-discovery page

Actual results:
etcd svc can not be discovered

Expected results:
etcd svc should be discovered

Additional info:

Comment 1 Junqi Zhao 2019-04-30 05:50:09 UTC
blocks etcd monitoring testing

Comment 2 Junqi Zhao 2019-04-30 05:53:46 UTC
Created attachment 1560176 [details]
prometheus-k8s sa info

Comment 3 Frederic Branczyk 2019-04-30 06:51:06 UTC
https://github.com/openshift/cluster-monitoring-operator/pull/339 opened

Comment 4 Frederic Branczyk 2019-04-30 09:46:01 UTC
PR merged.

Comment 6 Peter Ruan 2019-05-01 06:49:27 UTC
verified with 

I can see openshift-monitoring/etcd/0 in prometheus UI, and there's a etcd section under grafana

Comment 7 Peter Ruan 2019-05-01 06:50:35 UTC
verified with nightly build 4.1.0-0.nightly-2019-05-01-002148

Comment 9 errata-xmlrpc 2019-06-04 10:48:18 UTC
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.