How to Access the Cluster API from a Pod

Solution Verified - Updated -

Issue

When deploying applications on OpenShift, pods may need to interact with the cluster’s API server. Developers often need to configure the environment variables $KUBERNETES_SERVICE_HOST and $KUBERNETES_SERVICE_PORT within a pod to programmatically access the cluster API.

Environment

  • Openshift Container Platform (OCP)
  • Red Hat OpenShift on AWS (ROSA)
  • Azure Red Hat Openshift (ARO)

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