cadvisor README

The project's README from github.com/google/cadvisor. As one markdown file: README.md.

cAdvisor

test status

cAdvisor (Container Advisor) provides container users an understanding of the resource usage and performance characteristics of their running containers. It is a running daemon that collects, aggregates, processes, and exports information about running containers. Specifically, for each container it keeps resource isolation parameters, historical resource usage, histograms of complete historical resource usage and network statistics. This data is exported by container and machine-wide.

cAdvisor has native support for Docker containers and should support just about any other container type out of the box. We strive for support across the board so feel free to open an issue if that is not the case. cAdvisor's container abstraction is based on lmctfy's so containers are inherently nested hierarchically.

Quick Start: Running cAdvisor in a Docker Container

To quickly tryout cAdvisor on your machine with Docker, we have a Docker image that includes everything you need to get started. You can run a single cAdvisor to monitor the whole machine. Simply run:

VERSION=0.55.1 # use the latest release version from https://github.com/google/cadvisor/releases
sudo docker run \
  --volume=/:/rootfs:ro \
  --volume=/var/run:/var/run:ro \
  --volume=/sys:/sys:ro \
  --volume=/var/lib/docker/:/var/lib/docker:ro \
  --volume=/dev/disk/:/dev/disk:ro \
  --publish=8080:8080 \
  --detach=true \
  --name=cadvisor \
  --privileged \
  --device=/dev/kmsg \
  ghcr.io/google/cadvisor:$VERSION # for versions prior to v0.53.0, use gcr.io/cadvisor/cadvisor instead

cAdvisor is now running (in the background) on http://localhost:8080. The setup includes directories with Docker state cAdvisor needs to observe.

Note: If you're running on CentOS, Fedora, or RHEL (or are using LXC), take a look at our running instructions.

We have detailed instructions on running cAdvisor standalone outside of Docker. cAdvisor running options may also be interesting for advanced usecases. If you want to build your own cAdvisor Docker image, see our deployment page.

For Kubernetes users, cAdvisor can be run as a daemonset. See the instructions for how to get started, and for how to kustomize it to fit your needs.

Building and Testing

See the more detailed instructions in the build page. This includes instructions for building and deploying the cAdvisor Docker image.

Exporting stats

cAdvisor supports exporting stats to various storage plugins. See the documentation for more details and examples.

Web UI

cAdvisor exposes a web UI at its port:

http://<hostname>:<port>/

See the documentation for more details.

Remote REST API & Clients

cAdvisor exposes its raw and processed stats via a versioned remote REST API. See the API's documentation for more information.

There is also an official Go client implementation in the client directory. See the documentation for more information.

Roadmap

cAdvisor aims to improve the resource usage and performance characteristics of running containers. Today, we gather and expose this information to users. In our roadmap:

Community

Contributions, questions, and comments are all welcomed and encouraged! cAdvisor developers hang out on Slack in the #sig-node channel (get an invitation here). We also have discuss.kubernetes.io.

Please reach out and get involved in the project, we're actively looking for more contributors to bring on board!

Core Team

Frequent Collaborators

Emeritus

cadvisor (google/cadvisor)

Searching Database…

19.5K ·GitHub
这是什么?cAdvisor(Container Advisor,容器顾问)是一个守护进程,负责收集、汇总并导出运行中容器的资源使用和性能数据,例如 CPU、内存、网络以及历史使用统计信息。
这是独立的代理程序吗?还是需要其他东西才能运行?它是一个独立的守护进程,在每台机器上运行,提供网页界面和带版本号的 REST API;它原生支持 Docker,也可以在不使用 Docker 的机器上运行。
怎样才能把它跑起来?最快的方法是运行 cAdvisor 官方 Docker 镜像,它已包含监控整台机器所需的全部内容;也可以在 Docker 之外独立运行,或者将其部署为 Kubernetes DaemonSet。
使用它一定要装 Docker 吗?不一定。Docker 是最简单的方式,但并非必需;cAdvisor 原生支持 Docker,但基本上也能用于其他任何类型的容器,并且针对 CentOS、Fedora、RHEL、LXC 以及独立运行方式分别提供了单独的说明。
安装时有哪些需要注意的坑吗?如果你使用的是 CentOS、Fedora、RHEL 或 LXC,就需要按照专门的运行说明操作,而不能直接使用默认的 Docker 快速开始步骤。
它也能在 Kubernetes 集群上运行吗?可以,cAdvisor 能够部署为 Kubernetes DaemonSet,并支持使用 Kustomize 来适配你集群的需求。
可以把统计数据导出到外部存储系统吗?可以,cAdvisor 支持通过多种存储插件导出统计数据,并为不同的后端提供了文档和示例。
有没有可以用程序获取容器统计数据的 API?有,cAdvisor 提供带版本号的远程 REST API,用于获取原始及处理后的统计数据,并提供官方的 Go 客户端实现。
这个项目实际上会为每个容器记录哪些数据?对于每个容器,它会记录资源隔离参数、带直方图的历史资源使用情况以及网络统计信息,并且既按单个容器导出,也按整台机器导出。
cAdvisor 除了展示统计数据之外还有其他功能吗?目前它只负责收集和提供使用数据,但路线图中包括性能建议、容器自动调优,以及为集群调度器提供使用量预测。
Creator
google
Size
52.1 MB
Stars
19.5K
Age
12y
Commits · 90 Days