GithubHelp home page GithubHelp logo

paulpowershell / helm-exporter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sstarcher/helm-exporter

0.0 0.0 0.0 3.42 MB

Export helm stats into the Prometheus format

License: Apache License 2.0

Go 89.41% Dockerfile 2.24% Mustache 8.34%

helm-exporter's Introduction

Helm Exporter

Docker Registryย 

Exports helm release, chart, and version statistics in the prometheus format.

Installation

Prerequisites

  • Kubernetes 1.19+
  • Helm 3+

Get Repo Info

helm repo add sstarcher https://shanestarcher.com/helm-charts/
helm repo update

See helm repo for command documentation.

Install Chart

# Helm
$ helm install helm-exporter sstarcher/helm-exporter
  • helm install helm-exporter sstarcher/helm-exporter will install and metrics should scrape automatically if prometheus is running
  • If using Grafana you can use this Dashboard to have a list of what's running https://grafana.com/dashboards/9367

Configuration for Latest versions

Two options exist for fetching the latest version information for a chart.

  • Direct fetch from a chart repository. This will download the index for the registry and use that information to fetch the chart.
# Helm configuration
config:
  helmRegistries:
    overrideChartNames: {}
      mysql: stable/test
# If the helm charts are not stored on hub.helm.sh then a custom registry can be configured here.
# Currently only index.yaml registry is supported (helm supports other registries as well)
    override:
      - registry:
          url: "https://some.url" # Url to the index file
        charts: # Chart names
        - splunk
        - falco-eks-audit-bridge

Configuration for password protected registries

If the registry needs authentication then you can use a Kubernetes secret to store the username and password.

kubectl create secret generic chartmuseum --from-literal=username=admin --from-literal=password=admin

And use following configuration:

# Helm configuration
config:
  helmRegistries:
    overrideChartNames: {}
      mysql: stable/test
    # If the helm charts are not stored on hub.helm.sh then a custom registry can be configured here.
    # Currently only index.yaml registry is supported (helm supports other registries as well)
    override:
      - registry:
          url: "https://some.url" # Url to the index file
          secretRef:
              name: "chartmuseum" # Name of the secret containing the username and password
              userKey: "username" # Key of the username in the secret
              passKey: "password" # Key of the password in the secret
        charts: # Chart names
          - splunk
          - falco-eks-audit-bridge
  • Query https://artifacthub.io for the chart matching your chart name and only using the specified registries. If no registry name is specified and multiple charts match from helm hub no version will be found and it will log a warning.
# Helm configuration
config:
  helmRegistries:
    registryNames:
    - bitnami

Metrics

Format

# HELP helm_chart_info Information on helm releases
# TYPE helm_chart_info gauge
helm_chart_info{chart="ark",release="ark",version="1.2.1",latestVersion="1.2.3",appVersion="1.2.3",updated="1553201431",namespace="test"} 1
helm_chart_info{chart="cluster-autoscaler",release="cluster-autoscaler",version="0.7.0",latestVersion=7.3.2,appVersion="",updated="1553201431",namespace="other"} 4
helm_chart_info{chart="dex",release="dex",version="0.1.0",latestVersion="3.4.0",appVersion="1.2.3",updated="1553201431",namespace="test"} 1

# HELP helm_chart_outdated Outdated helm versions of helm releases
# TYPE helm_chart_outdated gauge
helm_chart_outdated{chart="ark",latestVersion="1.2.3",namespace="test",release="ark",version="1.2.1"} 1
helm_chart_outdated{chart="cluster-autoscaler",latestVersion="7.3.2",namespace="other",release="cluster-autoscaler",version="0.7.0"} 1
helm_chart_outdated{chart="external-secrets",latestVersion="3.4.0",namespace="test",release="dex",version="0.1.0"} 1

# HELP helm_chart_timestamp Timestamps of helm releases
# TYPE helm_chart_timestamp gauge
helm_chart_timestamp{chart="ark",release="ark",version="1.2.1",latestVersion="1.2.3",appVersion="1.2.3",updated="1553201431",namespace="test"} 1.617197959e+12
helm_chart_timestamp{chart="cluster-autoscaler",release="cluster-autoscaler",version="0.7.0",latestVersion=7.3.2,appVersion="",updated="1553201431",namespace="other"} 1.617196128e+12
helm_chart_timestamp{chart="dex",release="dex",version="0.1.0",latestVersion="3.4.0",appVersion="1.2.3",updated="1553201431",namespace="test"} 1.62245881e+12

The metric value is the helm status code. These status codes indexes do not map up directly to helm. This is so I can make the bad cases negative values.

  • -1 FAILED
  • 0 UNKNOWN
  • 1 DEPLOYED
  • 2 DELETED
  • 3 SUPERSEDED
  • 5 DELETING
  • 6 PENDING_INSTALL
  • 7 PENDING_UPGRADE
  • 8 PENDING_ROLLBACK

Prior Art

Todo

  • /healthz endpoint method

helm-exporter's People

Contributors

sstarcher avatar tuananhnguyen-ct avatar xrstf avatar knatsakis avatar vibioh avatar abhoite avatar amitbenami avatar devmage avatar benhartley avatar blacs30 avatar sharkofmirkwood avatar patrungel avatar dirien avatar jfrabaute avatar gminiba avatar ialejandro avatar jmccarty3 avatar rlex avatar nbenaglia avatar oliverbaehler avatar simon-gloot avatar tianhaopx avatar varyumin avatar ilyesaj avatar ekrucio avatar panzouh avatar penekk avatar philbo avatar uncycler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.