Bug 1768977

Summary: Grafana and prometheus oauth-proxy don't respect proxy CAs
Product: OpenShift Container Platform Reporter: Pablo Alonso Rodriguez <palonsor>
Component: MonitoringAssignee: Frederic Branczyk <fbranczy>
Status: CLOSED DUPLICATE QA Contact: Junqi Zhao <juzhao>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2.zCC: alegrand, anpicker, erooth, kakkoyun, lcosic, mloibl, pkrupa, surbania
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 17:51:54 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:
Embargoed:

Description Pablo Alonso Rodriguez 2019-11-05 17:18:29 UTC
Description of problem:

If I setup a proxy CA (trustedCA field at "proxy.config" CRD), it is not trusted by oauth-proxy containers of prometheus and grafana. So, when I try for example to login to grafana, login fails with 500 error.

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

4.2

How reproducible:

Always

Steps to Reproduce:
1. Set trustedCA at "proxy.config"
2. Make oauth endpoints present that CA. This can be achieved either by requiring the oauth route to go through proxy or by setting a custom certificate in default ingress controller.

Actual results:

Login does not work

Expected results:

Login should work

Additional info:

Posible way to fix this would be to create a configmap with "config.openshift.io/inject-trusted-cabundle=true" label so it gets populated with "trusted-ca-bundle" contents and make oauth endpoints trust it.

Discovered while validating this: https://bugzilla.redhat.com/show_bug.cgi?id=1712525#c39

Comment 1 Pablo Alonso Rodriguez 2019-11-05 17:19:47 UTC
Just for reference: openshift-console pods already do something similar to what I am suggesting and, hence, they don't face this issue

Comment 2 Pawel Krupa 2019-11-05 17:51:54 UTC
We are aware of this issue and actively working on a fix. It was previously reported in https://bugzilla.redhat.com/show_bug.cgi?id=1766181 so I am closing this BZ as a duplicate.

*** This bug has been marked as a duplicate of bug 1766181 ***