美文网首页
Kubernetes crictl管理命令详解

Kubernetes crictl管理命令详解

作者: 催化剂 | 来源:发表于2022-11-30 08:49 被阅读0次

1. 介绍

crictl 是 CRI 兼容的容器运行时命令行接口。 你可以使用它来检查和调试 Kubernetes 节点上的容器运行时和应用程序。 crictl 和它的源代码在 cri-tools 代码库。

2. 安装 crictl

下载:https://github.com/kubernetes-sigs/cri-tools/releases

3. 配置

crictl 命令有几个子命令和运行时参数。 有关详细信息,请使用 crictl help 或 crictl help 获取帮助信息。

root@master:/home/fpi# crictl help

NAME:

  crictl - client for CRI

USAGE:

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

VERSION:

  v1.24.2

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            Display the status of one or more pods

  logs                Fetch the logs of a container

  port-forward        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                Run a new pod

  rm                  Remove one or more containers

  rmi                Remove one or more images

  rmp                Remove one or more pods

  pods                List pods

  start              Start one or more created containers

  info                Display information of the container runtime

  stop                Stop one or more running containers

  stopp              Stop one or more running pods

  update              Update one or more running containers

  config              Get and set crictl client configuration options

  stats              List container(s) resource usage statistics

  statsp              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)

  --help, -h                          show help (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)

  --version, -v                      print the version (default: false)

原文参考:https://blog.csdn.net/xixihahalelehehe/article/details/116591151

相关文章

网友评论

      本文标题:Kubernetes crictl管理命令详解

      本文链接:https://www.haomeiwen.com/subject/plidfdtx.html