Metric server API shows error "You must be logged in to the server (Unauthorized)" for oc adm top command in OpenShift Container Platform 3.

Solution Verified - Updated -

Issue

  • oc adm top command throws an unauthorized message:
# oc adm top node
  error: You must be logged in to the server (Unauthorized)
  • Unable to get the metrics API :
# oc api-resources
  error: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: Unauthorized

# oc get --raw /apis/metrics.k8s.io/v1beta1
  error: You must be logged in to the server (Unauthorized)
  • HPA is not working

Environment

  • OpenShift Container Platform
    • 3.11

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content