Bug 1571176

Summary: [3.10] metrics API Proxy endpoint is deprecated in metrics.go
Product: OpenShift Container Platform Reporter: Junqi Zhao <juzhao>
Component: ocAssignee: Luke Meyer <lmeyer>
Status: CLOSED ERRATA QA Contact: Junqi Zhao <juzhao>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.10.0CC: ahoness, anli, aos-bugs, dmoessne, igreen, jokerman, mmccomas, mnoguera, rdiazgav, wsun
Target Milestone: ---   
Target Release: 3.10.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: The location of the master proxy API changed. Consequence: Since the MetricsApiProxy diagnostic uses this endpoint, it broke. Fix: The diagnostic was updated to look at the correct endpoint. Result: It should now work as expected.
Story Points: ---
Clone Of:
: 1632983 (view as bug list) Environment:
Last Closed: 2019-01-30 15:13: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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1632983    

Description Junqi Zhao 2018-04-24 09:00:48 UTC
Description of problem:
Deploy metrics 3.10 and run `oc adm diagnostics MetricsApiProxy`, result shows "Unable to access the metrics API Proxy endpoint /api/v1/proxy/namespaces/openshift-infra/services/https:heapster:/api/v1/model/metrics"

*********************************************************************
#oc adm diagnostics MetricsApiProxy
[Note] Determining if client configuration exists for client/cluster diagnostics
Info:  Successfully read a client config file at '/root/.kube/config'
Info:  Using context for cluster-admin access: 'openshift-infra/ip-172-18-0-226-ec2-internal:8443/system:admin'

[Note] Running diagnostic: MetricsApiProxy
       Description: Check the integrated heapster metrics can be reached via the API proxy
       
ERROR: [DClu4003 from diagnostic MetricsApiProxy@openshift/origin/pkg/oc/admin/diagnostics/diagnostics/cluster/metrics.go:89]
       Unable to access the metrics API Proxy endpoint /api/v1/proxy/namespaces/openshift-infra/services/https:heapster:/api/v1/model/metrics:
       (*errors.StatusError) the server could not find the requested resource
       The Horizontal Pod Autoscaler is not able to retrieve metrics to drive scaling.
       
[Note] Summary of diagnostics execution (version v3.10.0-0.27.0):
[Note] Errors seen: 1
*********************************************************************

The endpoints already changed to "api/v1/namespaces/openshift-infra/services/https:heapster:/proxy/api/v1/model/metrics" since 3.10,see
https://github.com/kubernetes/kubernetes/pull/59884 


Version-Release number of selected component (if applicable):
# openshift version
openshift v3.10.0-0.27.0
kubernetes v1.10.0+b81c8f8
etcd 3.2.16


How reproducible:
Always

Steps to Reproduce:
1. Deploy metrics 3.10 and run `oc adm diagnostics MetricsApiProxy`
2.
3.

Actual results:
Unable to access the metrics API Proxy endpoint /api/v1/proxy/namespaces/openshift-infra/services/https:heapster:/api/v1/model/metrics

Expected results:
Should not have error

Additional info:

Comment 1 Juan Vallejo 2018-04-24 15:14:55 UTC
Assigning to Luke as this appears to be related with diagnostics

Comment 11 Junqi Zhao 2019-01-17 02:44:22 UTC
Issue is fixed.

# oc adm diagnostics MetricsApiProxy
[Note] Determining if client configuration exists for client/cluster diagnostics
Info:  Successfully read a client config file at '/root/.kube/config'
Info:  Using context for cluster-admin access: 'default/preserve-310-master-etcd-1:8443/system:admin'

[Note] Running diagnostic: MetricsApiProxy
       Description: Check the integrated heapster metrics can be reached via the API proxy
       
[Note] Summary of diagnostics execution (version v3.10.101):
[Note] Completed with no errors or warnings seen.

# openshift version
openshift v3.10.101

Comment 13 errata-xmlrpc 2019-01-30 15:13: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.

https://access.redhat.com/errata/RHBA-2019:0206