grctl Command Line Tool

Install Command Line Tools

The command line tool grctl provides some tool commands that are convenient for Kato operation and maintenance. This tool is no longer built-in in the 5.2.0 version. If you use it, you need to install and install this command in advance; the user needs to enter the cluster management node, where Do the following.

The node must have the following conditions:

  1. The kubectl command is available and available. Please refer to kubectl for installation
  2. There is a ~/.kube/conf file to access the Kubernetes cluster.

Installation method:

docker run -it --rm -v /:/rootfs registry.gitlab.com/gridworkz/rbd-grctl:v5.3.0-release copy
mv /usr/local/bin/kato-grctl /usr/local/bin/grctl && grctl install

If it outputs Install success, the installation was successful.

Features

The grctl command is a cluster management tool independently developed by kato. It has the following main features:

Function 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 list column List all teams
grctl tenant get <team alias>List all applications of the team
grctl tenant res <team alias>The team uses resources
grctl build test pulls the source code Build and test after arriving locally.
grctl build list lists the current build tasks
grctl build log <task name>View the corresponding build task log
grctl gateway endpoints http column Export the HTTP strategy of the gateway proxy
grctl gateway endpoints staeam lists the TCP strategy of the gateway proxy
grctl envoy endpoints --node lists all the endpoints of the specified envoy node
Cluster node controlgrctl cluster View cluster status
grctl config View cluster region information, used to connect to public cloud
grctl node list View cluster node list
grctl node get < UID>View node status
grctl node cordon <UID>Set a node as unschedulable
grctl node uncordon <UID>Restore the scheduling of a node
grctl node resource View cluster resource usage
grctl node conditionNode condition

More information can be obtained through the grctl -h command

Cluster Management

  • View cluster information
grctl cluster
  • List cluster node information
grctl node list
  • Get detailed information of a node
grctl node get <UID>
  • Prohibit/allow scheduling to a certain node
# Prohibit 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 from the command line, copy the query command in the scaling interface of the application, and paste it on the main node of the server 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