Skip to content

Commit

Permalink
docs(): adding additions details to readme
Browse files Browse the repository at this point in the history
Signed-off-by: gkarthiks <github.gkarthiks@gmail.com>
  • Loading branch information
gkarthiks committed Mar 9, 2019
1 parent b21264d commit 9c64ec7
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,31 @@
![License](https://img.shields.io/github/license/gkarthiks/container-resource-exporter.svg)
![Release](https://img.shields.io/github/tag-date/gkarthiks/container-resource-exporter.svg?color=Orange&label=Latest%20Release)

Container Resource Exporter (CRE) is a simple metrics expoerter which will export the following data in the [Prometheus](https://prometheus.io/) format. This can be utilized to trigger a pro-active alert from the the [Prometheus Alert Manager](https://prometheus.io/docs/alerting/alertmanager).
Container Resource Exporter (CRE) is a metrics expoerter which will provide the *container* resource `request/limit/usage` metrics data on realtime in the [Prometheus](https://prometheus.io/) format. This can be utilized to trigger a pro-active alert from the the [Prometheus Alert Manager](https://prometheus.io/docs/alerting/alertmanager).

### Sample CRE metrics exported:

## Cluster Level:
By default the *CRE* will watch for the entire cluster, scrapes the resources for each and every container and exports them along with the total count of pods in each namesapces.

To run in the *cluster mode*, the *CRE* will require a *service account* which has cluster level read access and `list` actions on the resource `pods` in `core v1` apiGroup and `metrics` apiGroup.


## Contained Namespace:
To run the *CRE* in a contained namespace, i.e., watch only particular namespace; add the following environment variable `WATCH_NAMESPACE`. This can be easily accompolished with the `downward api` in *Kuberneres* as shown below.

```yaml
- env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
```
Still, *CRE* will require a *service account* which has access to `list` all the `pods` under `core v1` apiGroup and `metrics` apiGroup.

### Sample CRE metrics exported:

```prometheus
# HELP cpu_limit CPU Limit by deployment
# TYPE cpu_limit gauge
cpu_limit{container_name="alertmanager",namespace="default",pod_name="prometheus-alertmanager-74bd9d5867-gmlj9",status="Running "} 1
Expand Down Expand Up @@ -45,3 +65,16 @@ total_pod{namespace="default"} 1
```

Effortlessly get the Resources' request, limit and current usage by containers in your cluster/namespace.

## Sample Grafana dashboard visualization
The below sample [Grafana](https://grafana.com/) dashboard will show the sample metrics record for
- Total pods in the namespace over the time
- Total CPU Limit/Request/Usage in the namespace
- Total Memory Limit/Request/Usage in the namespace
- A sample pod's CPU Utilization
- A sample pod's Memory Utilization

![alt](./grafana-dashboard.jpeg)

## Docker Image:
The docker image ofcan be found [here <img src="./docker-logo.png" width="40" height="40" align="center"/> .](https://cloud.docker.com/repository/docker/gkarthics/container-resource-exporter)
Binary file added docker-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added grafana-dashboard.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9c64ec7

Please # to comment.