Skip to content

Commit

Permalink
Merge pull request #1323 from christianhuth/dev-github-exporter
Browse files Browse the repository at this point in the history
initial release of github-exporter
  • Loading branch information
christianhuth authored Feb 17, 2025
2 parents 6335cd8 + 9e9d5e4 commit 1286a30
Show file tree
Hide file tree
Showing 16 changed files with 1,091 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ body:
- baserow
- cluster-api-visualizer
- etcd-defrag
- github-exporter
- headwind-mdm
- kube-ops-view
- kubedoom
Expand Down
3 changes: 3 additions & 0 deletions .github/config/labeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ etcd-defrag:
fathom:
- changed-files:
- any-glob-to-any-file: charts/fathom/*
github-exporter:
- changed-files:
- any-glob-to-any-file: 'charts/github-exporter/*'
glances:
- changed-files:
- any-glob-to-any-file: charts/glances/*
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ You can then run `helm search repo christianhuth` to see the current list of ava
| [baserow](./charts/baserow) | [baserow/backend](https://hub.docker.com/r/baserow/backend), [baserow/web-frontend](https://hub.docker.com/r/baserow/web-frontend) | [Baserow is an open source no-code database and Airtable alternative.](https://baserow.io) |
| [cluster-api-visualizer](./charts/cluster-api-visualizer) | [jont828/cluster-api-visualizer](https://ghcr.io/jont828/cluster-api-visualizer) | [Multicluster resource visualization tool for Cluster API.](https://github.com/Jont828/cluster-api-visualizer) |
| [etcd-defrag](./charts/etcd-defrag) | [bitnami/etcd](https://hub.docker.com/r/bitnami/etcd) | [Runs a defragmentation CronJob for ETCD](https://etcd.io/docs/latest/op-guide/maintenance/#defragmentation) |
| [github-exporter](./charts/github-exporter) | [githubexporter/github-exporter](https://hub.docker.com/r/githubexporter/github-exporter) | [Prometheus Exporter for generating GitHub Metrics](https://github.com/githubexporter/github-exporter) |
| [headwind-mdm](./charts/headwind-mdm) | [headwindmdm/hmdm](https://hub.docker.com/r/headwindmdm/hmdm) | [Headwind MDM is an open source mobile device management software for Android](https://h-mdm.com) |
| [kube-ops-view](./charts/kube-ops-view) | [hjacobs/kube-ops-view](https://hub.docker.com/r/hjacobs/kube-ops-view) | [Kubernetes Operational View is a read-only system dashboard for multiple K8s clusters](https://codeberg.org/hjacobs/kube-ops-view) |
| [kubedoom](./charts/kubedoom) | [storax/kubedoom](https://ghcr.io/storax/kubedoom) | [Kill pods inside your Kubernetes cluster by shooting them in Doom!](https://github.com/storax/kubedoom) |
Expand Down
26 changes: 26 additions & 0 deletions charts/github-exporter/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

# Additional Helm Values for Development or Testing
values-*.yaml
7 changes: 7 additions & 0 deletions charts/github-exporter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# github-exporter

## 1.0.0

### Added

- Initial Release
20 changes: 20 additions & 0 deletions charts/github-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v2
name: github-exporter
description: A Helm Chart for the GitHub Prometheus Exporter
type: application
version: 1.0.0
appVersion: "1.3.1"
home: https://github.com/christianhuth/helm-charts
icon: https://raw.githubusercontent.com/simple-icons/simple-icons/develop/icons/github.svg
maintainers:
- name: christianhuth
email: [email protected]
sources:
- https://github.com/githubexporter/github-exporter
annotations:
artifacthub.io/changes: |
- kind: added
description: Initial Release
artifacthub.io/signKey: |
fingerprint: EE24F8BB6D099E78FD704F83B5ECDBCDDD485D0E
url: https://charts.christianhuth.de/public.key
97 changes: 97 additions & 0 deletions charts/github-exporter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# github-exporter

A Helm Chart for the GitHub Prometheus Exporter

## TL;DR;

```console
helm repo add christianhuth https://charts.christianhuth.de
helm repo update
helm install my-release christianhuth/github-exporter
```

## Introduction

This chart bootstraps the [GitHub Exporter](https://github.com/githubexporter/github-exporter) on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

## Prerequisites

- Kubernetes 1.19+

## Installing the Chart

To install the chart with the release name `my-release`:

```console
helm repo add christianhuth https://charts.christianhuth.de
helm repo update
helm install my-release christianhuth/github-exporter
```

These commands deploy the GitHub Exporter on the Kubernetes cluster in the default configuration. The [Values](#values) section lists the values that can be configured during installation.

> **Tip**: List all releases using `helm list`
## Uninstalling the Chart

To uninstall the `my-release` deployment:

```console
helm uninstall my-release
```

The command removes all the Kubernetes components associated with the chart and deletes the release.

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | Affinity settings for pod assignment |
| extraEnv | list | `[]` | additional environment variables to be added to the pods |
| fullnameOverride | string | `""` | String to fully override `"github-exporter.fullname"` |
| github.auth.app.enabled | bool | `false` | Enable authentication using a GitHub App. |
| github.auth.app.id | string | `""` | The APP ID of the GitHub App. |
| github.auth.app.installationId | string | `""` | The INSTALLATION ID of the GitHub App. |
| github.auth.app.privateKey | string | `""` | The private Key. |
| github.auth.existingSecret | string | `""` | Name of existing secret to use for authentication credentials. Keys in secret should be called `github-app-id`, `github-app-installation-id`, `github-app-private-key` or `github-token` depenending on the choosen authentication type (`github.auth.type``). |
| github.auth.token.enabled | bool | `false` | Enable authentication with an API Token |
| github.auth.token.value | string | `""` | The Token used to authenticate against the GitHub API |
| github.config.apiUrl | string | `"https://api.github.com"` | Github API URL, shouldn't need to change this. |
| github.config.logLevel | string | `"error"` | The level of logging the exporter will run with. |
| github.config.rateLimit | int | `0` | The rate limit that suppose to be for github app (default is 15,000). If the exporter sees the value is below this variable it generating new token for the app. |
| github.targets.organizations | string | `""` | If supplied, the exporter will enumerate all repositories for that organization. Expected in the format "org1, org2". |
| github.targets.repositories | string | `""` | If supplied, The repos you wish to monitor, expected in the format "user/repo1, user/repo2". Can be across different Github users/orgs. |
| github.targets.users | string | `""` | If supplied, the exporter will enumerate all repositories for that users. Expected in the format "user1, user2". |
| image.pullPolicy | string | `"Always"` | image pull policy |
| image.registry | string | `"docker.io"` | image registory |
| image.repository | string | `"githubexporter/github-exporter"` | image repository |
| image.tag | string | `"1.3.1"` | Overrides the image tag |
| imagePullSecrets | list | `[]` | If defined, uses a Secret to pull an image from a private Docker registry or repository. |
| nameOverride | string | `""` | Provide a name in place of `github-exporter` |
| nodeSelector | object | `{}` | Node labels for pod assignment |
| podSecurityContext | object | `{}` | pod-level security context |
| replicaCount | int | `1` | Number of replicas |
| resources | object | `{"requests":{"cpu":"100m","memory":"100Mi"}}` | Resource limits and requests for the controller pods. |
| revisionHistoryLimit | int | `0` | The number of old ReplicaSets to retain |
| securityContext | object | `{}` | container-level security context |
| service.port | int | `9171` | Kubernetes port where service is exposed |
| service.type | string | `"ClusterIP"` | Kubernetes service type |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
| serviceMonitor.additionalLabels | object | `{}` | Prometheus ServiceMonitor labels |
| serviceMonitor.enabled | bool | `false` | Enable a Prometheus ServiceMonitor |
| serviceMonitor.interval | string | `"30s"` | Prometheus ServiceMonitor interval |
| serviceMonitor.metricRelabelings | list | `[]` | Prometheus [MetricRelabelConfigs] to apply to samples before ingestion |
| serviceMonitor.namespace | string | `""` | Prometheus ServiceMonitor namespace |
| serviceMonitor.relabelings | list | `[]` | Prometheus [RelabelConfigs] to apply to samples before scraping |
| serviceMonitor.selector | object | `{}` | Prometheus ServiceMonitor selector |
| tolerations | list | `[]` | Toleration labels for pod assignment |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

```console
helm install my-release -f values.yaml christianhuth/github-exporter
```
52 changes: 52 additions & 0 deletions charts/github-exporter/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{{ template "chart.header" . }}
{{ template "chart.description" . }}

## TL;DR;

```console
helm repo add christianhuth https://charts.christianhuth.de
helm repo update
helm install my-release christianhuth/github-exporter
```

## Introduction

This chart bootstraps the [GitHub Exporter](https://github.com/githubexporter/github-exporter) on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

## Prerequisites

- Kubernetes 1.19+

## Installing the Chart

To install the chart with the release name `my-release`:

```console
helm repo add christianhuth https://charts.christianhuth.de
helm repo update
helm install my-release christianhuth/github-exporter
```

These commands deploy the GitHub Exporter on the Kubernetes cluster in the default configuration. The [Values](#values) section lists the values that can be configured during installation.

> **Tip**: List all releases using `helm list`

## Uninstalling the Chart

To uninstall the `my-release` deployment:

```console
helm uninstall my-release
```

The command removes all the Kubernetes components associated with the chart and deletes the release.

{{ template "chart.valuesSection" . }}

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

```console
helm install my-release -f values.yaml christianhuth/github-exporter
```
73 changes: 73 additions & 0 deletions charts/github-exporter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "github-exporter.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "github-exporter.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "github-exporter.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "github-exporter.labels" -}}
helm.sh/chart: {{ include "github-exporter.chart" . }}
{{ include "github-exporter.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "github-exporter.selectorLabels" -}}
app.kubernetes.io/name: {{ include "github-exporter.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "github-exporter.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "github-exporter.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Get the name of the secret containing the secrets for authentication against GitHub
*/}}
{{- define "github-exporter.auth.secretName" -}}
{{- if .Values.github.auth.existingSecret -}}
{{- printf "%s" .Values.github.auth.existingSecret -}}
{{- else -}}
{{- printf "%s" (include "github-exporter.fullname" .) -}}
{{- end -}}
{{- end -}}
Loading

0 comments on commit 1286a30

Please sign in to comment.