forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubernetes#298 from vmarmol/readme
Reorganizing cAdvisor docs and moving many of them to their own pages.
- Loading branch information
Showing
6 changed files
with
142 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# cAdvisor Remote REST API | ||
|
||
cAdvisor exposes its raw and processed stats via a versioned remote REST API: | ||
|
||
`http://<hostname>:<port>/api/<version>/<request>` | ||
|
||
The current version of the API is `v1.2`. | ||
|
||
## Version 1.2 | ||
|
||
This version exposes the same endpoints as `v1.1` with one additional read-only endpoint. | ||
|
||
### Docker Container Information | ||
|
||
The resource name for Docker container information is as follows: | ||
|
||
`/api/v1.2/docker/<Docker container name or blank for all Docker containers>` | ||
|
||
The Docker name can be either the UUID or the short name of the container. It returns the information of the specified container(s). The information is returned as a list of serialized `ContainerInfo` JSON objects (found in [info/container.go](info/container.go)). | ||
|
||
## Version 1.1 | ||
|
||
This version exposes the same endpoints as `v1.0` with one additional read-only endpoint. | ||
|
||
### Subcontainer Information | ||
|
||
The resource name for subcontainer information is as follows: | ||
|
||
`/api/v1.1/subcontainers/<absolute container name>` | ||
|
||
Where the absolute container name follows the lmctfy naming convention (described bellow). It returns the information of the specified container and all subcontainers (recursively). The information is returned as a list of serialized `ContainerInfo` JSON objects (found in [info/container.go](info/container.go)). | ||
|
||
## Version 1.0 | ||
|
||
This version exposes two main endpoints, one for container information and the other for machine information. Both endpoints are read-only in v1.0. | ||
|
||
### Container Information | ||
|
||
The resource name for container information is as follows: | ||
|
||
`/api/v1.0/containers/<absolute container name>` | ||
|
||
Where the absolute container name follows the lmctfy naming convention. For example: | ||
|
||
| Container Name | Resource Name | | ||
|----------------------|-------------------------------------------| | ||
| / | /api/v1.0/containers/ | | ||
| /foo | /api/v1.0/containers/foo | | ||
| /docker/2c4dee605d22 | /api/v1.0/containers/docker/2c4dee605d22 | | ||
|
||
Note that the root container (`/`) contains usage for the entire machine. All Docker containers are listed under `/docker`. | ||
|
||
The container information is returned as a JSON object containing: | ||
|
||
- Absolute container name | ||
- List of subcontainers | ||
- ContainerSpec which describes the resource isolation enabled in the container | ||
- Detailed resource usage statistics of the container for the last `N` seconds (`N` is globally configurable in cAdvisor) | ||
- Histogram of resource usage from the creation of the container | ||
|
||
The actual object is the marshalled JSON of the `ContainerInfo` struct found in [info/container.go](info/container.go) | ||
|
||
### Machine Information | ||
|
||
The resource name for machine information is as follows: | ||
|
||
`/api/v1.0/machine` | ||
|
||
This resource is read-only. The machine information is returned as a JSON object containing: | ||
|
||
- Number of schedulable logical CPU cores | ||
- Memory capacity (in bytes) | ||
|
||
The actual object is the marshalled JSON of the `MachineInfo` struct found in [info/machine.go](info/machine.go) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# cAdvisor API Clients | ||
|
||
There is an official Go client implementation in the [client](client/) directory. You can use it on your own Go project by including it like this: | ||
|
||
```go | ||
import "github.com/google/cadvisor/client" | ||
|
||
client, err = client.NewClient("http://localhost:8080/") | ||
mInfo, err := client.MachineInfo() | ||
``` | ||
|
||
Do you know of another cAdvisor client? Maybe in another language? Please let us know! We'd be happy to add a note on this page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Building and Deploying the cAdvisor Docker Container | ||
|
||
## Building | ||
|
||
Building the cAdvisor Docker container is simple, just run: | ||
|
||
``` | ||
$ ./deploy/build.sh | ||
``` | ||
|
||
Which will statically build the cAdvisor binary and then build the Docker image. The resulting Docker image will be called `google/cadvisor:canary`. This image is very bare, containing the cAdvisor binary and nothing else. | ||
|
||
## Deploying | ||
|
||
All cAdvisor releases are tagged and correspond to a Docker image. The latest supported release uses the `latest` tag. We have a `beta` and `canary` tag for pre-release versions with newer features. You can see more details about this in the cAdvisor Docker [registry](https://registry.hub.docker.com/u/google/cadvisor/) page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#### Exporting cAdvisor Stats to InfluxDB | ||
|
||
cAdvisor supports exporting stats to [InfluxDB](http://influxdb.com). To use InfluxDB, you need to pass some additional flags to cAdvisor telling it where the InfluxDB instance is located: | ||
|
||
**Required** | ||
``` | ||
# storage driver to use. Options are: memory (default) and influxdb | ||
-storage_driver=influxdb | ||
``` | ||
**Optional** | ||
``` | ||
# The *ip:port* of the database. Default is 'localhost:8086' | ||
-storage_driver_host=ip:port | ||
# database name. Uses db 'cadvisor' by default | ||
-storage_driver_name | ||
# database username. Default is 'root' | ||
-storage_driver_user | ||
# database password. Default is 'root' | ||
-storage_driver_password | ||
# Use secure connection with database. False by default | ||
-storage_driver_secure | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# cAdvisor Web UI | ||
|
||
cAdvisor exposes a web UI at its port: | ||
|
||
`http://<hostname>:<port>/` | ||
|
||
This UI has one primary resource at `/containers` which exports live information about all containers on the machine. |