containerd命令--ctr和crictl

发布时间 2023-04-03 12:19:09作者: du-z

ctr

[root@master ~]# ctr --help
NAME:
   ctr - containerd CLI

USAGE:
   ctr [global options] command [command options] [arguments...]

VERSION:
   v1.6.19

DESCRIPTION:

ctr is an unsupported debug and administrative client for interacting with the containerd daemon. Because it is unsupported, the commands,options, and operations are not guaranteed to be backward compatible or stable from release to release of the containerd project.

ctr是一个不受支持的调试和管理客户端,用于与containerd守护进程交互。由于不支持它,因此无法保证命令、选项和操作在containerd项目的各个版本之间向后兼容或稳定。


COMMANDS:
   plugins, plugin                 提供了有关containerd插件的信息    provides information about containerd plugins     
   version                         打印客户端和服务器版本            print the client and server versions              
   containers, c, container        管理容器                          manage containers                                 
   content                         管理内容                          manage content                                    
   events, event                   显示容器事件                      display containerd events                         
   images, image, i                管理镜像                          manage images                                     
   leases                          管理租赁                          manage leases                                     
   namespaces, namespace, ns       管理命名空间                      manage namespaces                                 
   pprof                           为containerd提供golang-prof输出   provide golang pprof outputs for containerd       
   run                             运行容器                          run a container                                   
   snapshots, snapshot             管理快照                          manage snapshots                                  
   tasks, t, task                  管理任务                          manage tasks                                      
   install                         安装新程序包                      install a new package                             
   oci                             OCI工具                           OCI tools                                         
   shim                            直接与垫片相互作用                interact with a shim directly                     
   help, h                         显示命令列表或一个命令的帮助      Shows a list of commands or help for one command  

GLOBAL OPTIONS:
   --debug                      enable debug output in logs
   --address value, -a value    address for containerd's GRPC server (default: "/run/containerd/containerd.sock") [$CONTAINERD_ADDRESS]
   --timeout value              total timeout for ctr commands (default: 0s)
   --connect-timeout value      timeout for connecting to containerd (default: 0s)
   --namespace value, -n value  namespace to use with commands (default: "default") [$CONTAINERD_NAMESPACE]
   --help, -h                   show help
   --version, -v                print the version

crictl

[root@master ~]# crictl --help
NAME:
   crictl - client for CRI

USAGE:
   crictl [global options] command [command options] [arguments...]

VERSION:
   1.24.1

COMMANDS:
   attach                   连接到正在运行的容器                 Attach to a running container                    
   create                   创建新容器                           Create a new container                           
   exec                     在运行容器中运行命令                 Run a command in a running container             
   version                  显示运行时版本信息                   Display runtime version information              
   images, image, img       列出镜像                             List images                                      
   inspect                  显示一个或多个容器的状态             Display the status of one or more containers     
   inspecti                 返回一个或多个镜像的状态             Return the status of one or more images          
   imagefsinfo              返回镜像文件系统信息                 Return image filesystem info                     
   inspectp                 显示一个或多个pod的状态             Display the status of one or more pods           
   logs                     获取容器的日志                       Fetch the logs of a container                    
   port-forward             将本地端口转发到pod                 Forward local port to a pod                      
   ps                       列出容器                             List containers                                  
   pull                     从仓库中提取镜像                   Pull an image from a registry                    
   run                      在沙盒中运行新容器                   Run a new container inside a sandbox             
   runp                     运行新pod                           Run a new pod                                    
   rm                       移除一个或多个容器                   Remove one or more containers                    
   rmi                      删除一个或多个镜像                   Remove one or more images                        
   rmp                      移除一个或多个pod                   Remove one or more pods                          
   pods                     列出pod                              List pods                                        
   start                    启动一个或多个创建的容器             Start one or more created containers             
   info                     显示容器运行时的信息                 Display information of the container runtime     
   stop                     停止一个或多个正在运行的容器         Stop one or more running containers              
   stopp                    停止一个或多个跑步pod               Stop one or more running pods                    
   update                   更新一个或多个正在运行的容器         Update one or more running containers            
   config                   获取并设置crictl客户端配置选项       Get and set crictl client configuration options  
   stats                    列出容器资源使用情况统计信息         List container(s) resource usage statistics      
   statsp                   列出pod资源使用情况统计信息          List pod resource usage statistics               
   completion               输出外壳完成代码                     Output shell completion code                     
   help, h                  显示命令列表或一个命令的帮助         Shows a list of commands or help for one command 

GLOBAL OPTIONS:
   --config value, -c value            Location of the client config file. If not specified and the default does not exist, the program's directory is searched as well (default: "/etc/crictl.yaml") [$CRI_CONFIG_FILE]
   --debug, -D                         Enable debug mode (default: false)
   --image-endpoint value, -i value    Endpoint of CRI image manager service (default: uses 'runtime-endpoint' setting) [$IMAGE_SERVICE_ENDPOINT]
   --runtime-endpoint value, -r value  Endpoint of CRI container runtime service (default: uses in order the first successful one of [unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock]). Default is now deprecated and the endpoint should be set instead. [$CONTAINER_RUNTIME_ENDPOINT]
   --timeout value, -t value           Timeout of connecting to the server in seconds (e.g. 2s, 20s.). 0 or less is set to default (default: 2s)
   --help, -h                          show help (default: false)
   --version, -v                       print the version (default: false)