KubeSphere API
KubeSphere v3.0 moves the functionalities of ks-apigateway and ks-account into ks-apiserver to make the architecture more compact and clear. In order to use the KubeSphere API, you need to expose ks-apiserver to your client.
If you are going to access KubeSphere inside the cluster, you can skip the following section and just use the KubeSphere API server endpoint .
On the other hand, you need to expose the KubeSphere API server endpoint outside the cluster first.
Now, you can access ks-apiserver
outside the cluster through the URL like , where [node ip]
means the IP address of any node in your cluster.
You need to identify yourself before making any call to the API server. The following example uses the password P#$$w0rd
. The user needs to issue a request to generate a token as below:
Note
Replace [node ip]
with your actual IP address. You can configure client credentials in ClusterConfiguration
, there is a default client credential and client_secret
is kubesphere
.
If you have everything you need to access the KubeSphere API server, make the call using the access token acquired above as shown in the following example to get the node list:
Note
Replace [node ip]
with your actual IP address.
The KubeSphere API swagger JSON file can be found in the repository https://github.com/kubesphere/kubesphere/tree/release-3.1/api.
- KubeSphere specified the API file. It contains all the APIs that are only applied to KubeSphere.
- KubeSphere specified the CRD swagger json file. It contains all the generated CRDs API documentation. It is same as Kubernetes API objects.