Skip to main content

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:

  1. Has the kubectl command and is available.Please refer tokubectlfor installation
  2. 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 moduleCommand example
Platform application controlgrctl service get <application alias> -t <team alias> view application details
grctl service list -t <team alias> list application information
grctl tenant listlist all teams
grctl tenant get <Team alias>List all applications of the team
grctl tenant res <Team alias>The team uses resources
grctl build testPull the source code to the local for build test
grctl build listList the current Build task
grctl build log <Task name>View the corresponding build task log
grctl gateway endpoints httpList the HTTP policy of the gateway proxy
grctl gateway endpoints staeamList the TCP policy of the gateway proxy
grctl envoy endpoints --nodelist all endpoints of the specified envoy node
Cluster Node Controlgrctl cluster View cluster status
grctl configView cluster region information, which is used to connect to the public cloud
grctl node list View cluster node list
grctl node get <UID>View node status
grctl node cordon <UID>Will A node is set to be unschedulable
grctl node uncordon <UID>Resume the scheduling of a node
grctl node resourceView cluster resource usage
grctl node conditionNode 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 the scaling 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