Web Kubectl
The Kubernetes command-line tool, kubectl, allows you to run commands on Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs.
KubeSphere provides web kubectl on the console for user convenience. By default, in the current version, only the account granted the platform-admin
role (such as the default account admin
) has the permission to use web kubectl for cluster resource operation and management.
Objective
In this tutorial, you will learn how to use web kubectl to operate on and manage cluster resources.
Use Web Kubectl
- Log in KubeSphere with an account granted the
platform-admin
role, hover over the Toolbox in the lower right corner and select Kubectl.
- You can see the kubectl interface as shown in the pop-up window. If you have enabled the multi-cluster feature, you need to select the target cluster first from the drop-down list in the upper right corner. This drop-down list is not visible if the multi-cluster feature is not enabled.
- Enter kubectl commands in the command-line tool to query and manage Kubernetes cluster resources. For example, execute the following command to query the status of all PVCs in the cluster.
kubectl get pvc --all-namespaces
- Use the following syntax to run kubectl commands from your terminal window:
kubectl [command] [TYPE] [NAME] [flags]
Note
- Where
command
,TYPE
,NAME
, andflags
are:command
: Specifies the operation that you want to perform on one or more resources, such ascreate
,get
,describe
anddelete
.TYPE
: Specifies the resource type. Resource types are case-insensitive and you can specify the singular, plural, or abbreviated forms.NAME
: Specifies the name of the resource. Names are case-sensitive. If the name is omitted, details for all resources are displayed, such askubectl get pods
.flags
: Specifies optional flags. For example, you can use the-s
or--server
flags to specify the address and port of the Kubernetes API server.
- If you need help, run
kubectl help
from the terminal window or refer to the Kubernetes kubectl CLI documentation.
当前内容版权归 KubeSphere 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 KubeSphere .