How to Access the Cluster API from a Pod
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.