Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix in-cluster API discovery documentation #36691

Merged
merged 4 commits into from
Jan 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions content/en/docs/tasks/run-application/access-api-from-pod.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ securely with the API server.

### Directly accessing the REST API

While running in a Pod, the Kubernetes apiserver is accessible via a Service named
`kubernetes` in the `default` namespace. Therefore, Pods can use the
`kubernetes.default.svc` hostname to query the API server. Official client libraries
do this automatically.
While running in a Pod, the Kubernetes API server is referenced by the environment
variables `KUBERNETES_SERVICE_HOST` and `KUBERNETES_SERVICE_PORT`. As a convenience,
the API server may also be referenced via a Service named `kubernetes` in the `default`
namespace. Therefore, Pods can use the `kubernetes.default.svc` hostname to query the
API server.

The recommended way to authenticate to the API server is with a
[service account](/docs/tasks/configure-pod-container/configure-service-account/)
Expand Down