Kubernetes API

You can access the Kubernetes API documents from the following locations:

Running Kubernetes API commands

When you run a Kubernetes API command, you must obtain and specify the authentication header. See Preparing to run component or management API commands.

After you obtain that information, you can run Kubernetes API commands. For example, to list the pods in the default namespace, run the following command:

curl -k -H "Authorization:Bearer $ID_TOKEN"  https://<Cluster Master Host>:<Kubernetes API Port>/api/v1/namespaces/default/pods

In this command:

The output resembles the following code:

{   "kind": "PodList",
"apiVersion": "v1",   "metadata": {     "selfLink": "/api/v1/namespaces
/default/pods", "resourceVersion": "414"   },   "items": [{...}, {...}] }