Bug 1818772 - Wrong serverName for certificate on /metrics endpoint
Summary: Wrong serverName for certificate on /metrics endpoint
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.5
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 4.5.0
Assignee: Jakub Hadvig
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks: 1836938
TreeView+ depends on / blocked
 
Reported: 2020-03-30 10:41 UTC by Pawel Krupa
Modified: 2020-07-13 17:24 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Incorrect handling of cert rotation. Consequence: /metrics endpoint cannot be scraped by prometheus due to incorrect serverName in TLS cert. Fix: Bump go dependencies in the console-operator repo to pick up latest changes in the library-go. Result: /metrics endpoint can be scraped by prometheus.
Clone Of:
Environment:
Last Closed: 2020-07-13 17:24:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:24:33 UTC

Description Pawel Krupa 2020-03-30 10:41:34 UTC
Description of problem:
/metrics endpoint cannot be scraped by prometheus due to incorrect serverName in TLS cert.

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

How reproducible:
often

Steps to Reproduce:
1. Start a cluster
2. Go to prometheus targets page
3. Scroll to openshift-console-operator/console-operator/0

Actual results:
Target is down due to:
Get https://10.128.0.32:8443/metrics: x509: certificate is valid for localhost, not metrics.openshift-console-operator.svc

Expected results:
Target is up

Additional info:

Comment 1 Jakub Hadvig 2020-03-31 08:36:34 UTC
Closing this one after trying to reproduce with Pawel's assistance.
The ServiceMonitor responsible for the /metrics endpoint to be scraped was validated
and looks without any issue:
https://github.com/openshift/console-operator/blob/master/manifests/0000_90_console-operator_02_servicemonitor.yaml

We agreed to close the bug since it's most probably a flake.

Comment 6 Jakub Hadvig 2020-05-18 14:20:45 UTC
This issue should be fixed by the latest go deps bump.
Putting on ON_QA

Comment 7 shahan 2020-05-19 05:31:16 UTC
goto https://prometheus-k8s-openshift-monitoring.apps.qe-groupd-0519.qe.devcluster.openshift.com/targets page and check openshift-console-operator/console-operator/0 part.
no "x509: certificate is valid for localhost, not metrics.openshift-console-operator.svc errors" found
4.5.0-0.nightly-2020-05-18-225907

Comment 10 errata-xmlrpc 2020-07-13 17:24:11 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.

https://access.redhat.com/errata/RHBA-2020:2409


Note You need to log in before you can comment on or make changes to this bug.