grctl CLI
Install command line tools
The command line tool grctl
provides some tool commands that are convenient for Rainbond operation and maintenance. In version 5.2.0
, the tool is no longer built-in. If you use it, you need to install this command in advance; the user needs to enter the cluster management node, on the node Do the following.
The node must have the following conditions:
- Has the kubectl command and is available.Please refer tokubectlfor installation
- There is a ~/.kube/conf file that accesses the Kubernetes cluster.
Installation method:
docker run -it --rm -v /:/rootfs registry.cn-hangzhou.aliyuncs.com/goodrain/rbd-grctl:v5.8.1-release copy
mv /usr/local/bin/rainbond-grctl /usr/ local/bin/grctl && grctl install
If Install success
is output, the installation is successful.
Features
The grctl command is a cluster management tool independently developed by rainbond. It has the following main features::
functional module | Command example |
---|---|
Platform application control | grctl service get <application alias> -t <team alias> view application detailsgrctl service list -t <team alias> list application informationgrctl tenant list list all teamsgrctl tenant get <Team alias> List all applications of the teamgrctl tenant res <Team alias> The team uses resourcesgrctl build test Pull the source code to the local for build testgrctl build list List the current Build taskgrctl build log <Task name> View the corresponding build task loggrctl gateway endpoints http List the HTTP policy of the gateway proxygrctl gateway endpoints staeam List the TCP policy of the gateway proxygrctl envoy endpoints --node list all endpoints of the specified envoy node |
Cluster Node Control | grctl cluster View cluster statusgrctl config View cluster region information, which is used to connect to the public cloudgrctl node list View cluster node listgrctl node get <UID> View node statusgrctl node cordon <UID> Will A node is set to be unschedulablegrctl node uncordon <UID> Resume the scheduling of a nodegrctl node resource View cluster resource usagegrctl node condition Node condition |
More information can be obtained by
grctl -h
command
Cluster management
- View cluster information
grctl cluster
- List cluster node information
grctl node list
- Get details of a node
grctl node get <UID>
- Disable/Allow scheduling to a node
# Disable scheduling to a node
grctl node cordon <UID>
# Allow scheduling to a node
grctl node uncordon <UID>
Application management
- Get the detailed information of the application on the command line, copy the
query command
on thescaling
interface of the application, and paste it on the server master node to view the detailed information of the current application
grctl service get grf2ebfd -t b40hkf9y
If you need to view the real-time log of the application, use the PodName/Namespace
information obtained by the above command to view the real-time log of the application running
root@ubuntu:~# kubectl logs -f fa0a524589beabdc4503acd253f2ebfd-deployment-56dd54844d-m978r -n 1f732b0aadc94bd0ba288deff3a08c3f
Launching nginx
Note: If there are multiple containers in a pod, you need to specify the name of the container to be queried after
PodName