How to Invoke KubeSphere API
ks-apigatway’s service port can be set as NodePort. In this way, ks-apigatway service can be exposed. You can choose to use UI or commands to realize the exposure:
Using KubeSphere UI
Log in KubeSphere console and enter into
system-workspace
-> projectkubesphere-system
. In the service list, click and enter into the service’s page of .You can find the generated NodePort as NodePort in the service page.
Using Command
Using Command
- Log in to KubeSphere using the admin account, open Web Kubectl in the 「Toolbox」 in the lower right corner, and execute the following command
- Use the following command to view the generated port number. The port number returned is 31078.
Open Web Kubectl at the lower right corner of KubeSphere. Execute the following commands where 192.168.0.20
is the sample’s node IP and 31078 is the ks-apigatway service exposed in the previous step.
After getting the Access Token, the KubeSphere API can be invoked in a user-defined request function. For further details, please refer to .
KubeSphere’s API can be previewed in Swagger UI. Access the URL to visit Swagger UI such as http://192.168.0.20:31078/swagger-ui/
.