This repository enables prometheus scrapping 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. The original source of the Python script can be found here.
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:
- run
helm repo add viadee https://viadee.github.io/docker-hub-rate-limit-exporter
- run
helm install <release-name> viadee/docker-hub-rate-limit-exporter
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:
- Create a helm value file as per the example in this repository (see: chart/values.yaml)
- Fill in the variables
dockerhubUsername
anddockerhubPassword
. It is recommended to use a dockerhub access token for the password. - Run
helm upgrade <release name> viadee/docker-hub-rate-limit-exporter --install --namespace=<desired namespace> -f <name of value file>
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 scrap the docker-hub-rate-limit-exporter. To do so follow the steps below:
- Create a helm value file as per the example in this repository or use the value file from above (see: chart/values.yaml)
- Set the variable
serviceMonitor.enabled
to true - Depending on the configuration of your Prometheus Operator you might need to configure the
serviceMonitor.additionalLabels
section to tell prometheus to scrape from thisServiceMonitor
resource. - Alternatively, you might have configured the Prometheus Operator to consider all
ServiceMonitors
in a specific namespace. In that case you can set theserviceMonitor.namespace
option to deploy theServiceMonitor
resource in that namespace. - Run
helm upgrade <release name> viadee/docker-hub-rate-limit-exporter --install --namespace=<desired namespace> -f <name of value file>
If you are not using the prometheus kubernetes operator you would need to configure prometheus manually to scrap the metrics.
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.
trigger