Skip to content

viadee/docker-hub-rate-limit-exporter

Repository files navigation

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. The original source of the Python script can be found here.

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 <release-name> 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 <release name> viadee/docker-hub-rate-limit-exporter --install --namespace=<desired namespace> -f <name of value file>

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 <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 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.