As a user of Kubernetes, the command I use most every day is kubectl XXX.

Kubectl is a console that provides the following functions:

1. Provide Kubernetes REST API for cluster management, including authentication and authorization, data verification, and cluster status change;

2. Provide a hub for data interaction and communication between other modules (other modules query or modify data through THE API Server, and only the API Server can directly operate ETCD)

That is, every kubectl command we type in the terminal is actually a Restful API call to Kubernetes API Server.

We can do an experiment:

Kubectl get secret -v=9;

Observed from the output in order to retrieve all the secret of the API calls the server url: https://xxxx/api/v1/namespaces//secrets? limit=500:

The format of the HTTP request can be found on Kubernetes website.

So how does kubectl know which API server to send the request to?

Use kubectl config view to display the url of the API server.

Kubectl config view displays the contents from the configuration file: ~/. Kube /config:

Kubectl for Kubernetes works in the same way as CF for CloudFoundry.

Set the operating system environment variable CF_TRACE = true

You can then execute any CF commands and see that these commands actually send an HTTP request to an endpoint in the SAP Cloud Platform.

Cf logs connectvity-demo-approuter –recent

You can then see the payload of the HTTP requests and responses sent to complete the command.

For more of Jerry’s original articles, please follow the public account “Wang Zixi “: