https://github.com/viadee/docker-hub-rate-limit-exporter
Know your limits - Via Prometheus
https://github.com/viadee/docker-hub-rate-limit-exporter
cloud dockerhub dockerhub-limits helm helm-chart metrics prometheus
Last synced: 3 months ago
JSON representation
Know your limits - Via Prometheus
- Host: GitHub
- URL: https://github.com/viadee/docker-hub-rate-limit-exporter
- Owner: viadee
- License: mit
- Created: 2020-11-23T13:07:30.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-04-23T10:13:36.000Z (over 1 year ago)
- Last Synced: 2024-04-23T13:25:31.013Z (over 1 year ago)
- Topics: cloud, dockerhub, dockerhub-limits, helm, helm-chart, metrics, prometheus
- Language: Python
- Homepage:
- Size: 1.25 MB
- Stars: 40
- Watchers: 11
- Forks: 14
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HELM Chart for docker-hub-rate-limit-exporter

This repository enables Prometheus scraping of dockerhub rate limits by providing a ready to use docker image and helm chart.
You can find more background information in this blog post: https://blog.viadee.de/en/monitoring-the-docker-hub-rate-limit-with-prometheus
Note: The content of this repository is based on the work done by gitlab as described in their [blogpost](https://about.gitlab.com/blog/2020/11/18/docker-hub-rate-limit-monitoring/). The original source of the Python script can be found [here](https://gitlab.com/gitlab-com/marketing/corporate_marketing/developer-evangelism/code/docker-hub-limit-exporter).
## Upgrade from 0.2.x to 0.3.0
In 0.3.0 the config path for supplying the dockerhub credentials has been changed. If you monitor authenticated requests and you want to update to 0.3.0, then you have to change `config.dockerhubUsername` and `config.dockerhubPassword` to `config.dockerhub.username` and `config.dockerhub.password`.
## How to install the chart
The helm chart can be installed through a helm chart repository hosted on a github page in this repository. To install follow the next steps:
1. run `helm repo add viadee https://viadee.github.io/docker-hub-rate-limit-exporter`
2. run `helm install viadee/docker-hub-rate-limit-exporter`## How to configure your docker credentials
If your kubernetes cluster does not authenticate with dockerhub you don't need to do anything here. However, if it does, you need to configure the crendetials with helm values. This is because the docker-hub-rate-limit-exporter does not use the dockerhub account assosiated with the docker context of your kubernetes-cluster. You can configure it to do so by following the steps below:
1. Create a helm value file as per the example in this repository (see: chart/values.yaml)
2. Fill in the variables `config.dockerhub.username` and `config.dockerhub.password`. It is recommended to use a dockerhub access token for the password.
3. Run `helm upgrade viadee/docker-hub-rate-limit-exporter --install --namespace= -f `## How to tell Prometheus to scrape the metrics
We recommend you to use the Prometheus kubernetes operator to run Prometheus in your cluster (see: https://github.com/prometheus-operator/prometheus-operator). If you run the operator you can create a `ServiceMonitor` resource to tell Prometheus how to scrape the docker-hub-rate-limit-exporter. To do so follow the steps below:
1. Create a helm value file as per the example in this repository or use the value file from above (see: chart/values.yaml)
2. Set the variable `serviceMonitor.enabled` to true
3. Depending on the configuration of your Prometheus Operator you might need to configure the `serviceMonitor.additionalLabels` section to tell Prometheus to scrape from this `ServiceMonitor` resource.
4. Alternatively, you might have configured the Prometheus Operator to consider all `ServiceMonitors` in a specific namespace. In that case you can set the `serviceMonitor.namespace` option to deploy the `ServiceMonitor` resource in that namespace.
5. Run `helm upgrade viadee/docker-hub-rate-limit-exporter --install --namespace= -f `If you are not using the Prometheus kubernetes operator you would need to configure Prometheus manually to scrape the metrics.
## Collaboration
This helm chart was build by viadee Unternehmensberatung AG. If you are interested to find out what else we are doing, check out our website: https://www.viadee.de/en/solutions/cloud
If you have any feedback, ideas or extensions feel free to reach out and create a GitHub issue.