Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
Signed-off-by: Eirik A <[email protected]>
  • Loading branch information
clux authored Jan 11, 2024
2 parents 3d99570 + a5a6939 commit 1a46d5c
Show file tree
Hide file tree
Showing 19 changed files with 619 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@
/charts/prometheus-snmp-exporter/ @miouge1 @xiu
/charts/prometheus-stackdriver-exporter/ @apenney @rpahli
/charts/prometheus-statsd-exporter/ @scDisorder
/charts/prometheus-systemd-exporter/ @capuche2412
/charts/prometheus-to-sd/ @acondrat
/charts/prometheus-windows-exporter/ @jkroepke
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
alertmanager:
ingress:
enabled: true
hosts:
- "*.test.com"
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
rules:
{{- if .Values.alertmanager.ingress.hosts }}
{{- range $host := .Values.alertmanager.ingress.hosts }}
- host: {{ tpl $host $ }}
- host: {{ tpl $host $ | quote }}
http:
paths:
{{- range $p := $paths }}
Expand Down
4 changes: 2 additions & 2 deletions charts/prom-label-proxy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: prom-label-proxy
description: A proxy that enforces a given label in a given PromQL query.
type: application
version: 0.6.0
appVersion: "v0.7.0"
version: 0.7.0
appVersion: "v0.8.0"
home: "https://github.com/prometheus-community/prom-label-proxy"
keywords:
- metric
Expand Down
4 changes: 2 additions & 2 deletions charts/prometheus-memcached-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: prometheus-memcached-exporter
description: Prometheus exporter for Memcached metrics
type: application
version: 0.3.0
appVersion: "v0.14.1"
version: 0.3.1
appVersion: "v0.14.2"
home: https://github.com/prometheus/memcached_exporter
sources:
- https://github.com/prometheus/memcached_exporter
Expand Down
2 changes: 1 addition & 1 deletion charts/prometheus-mysql-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: A Helm chart for prometheus mysql exporter with cloudsqlproxy
name: prometheus-mysql-exporter
version: 2.3.0
version: 2.4.0
home: https://github.com/prometheus/mysqld_exporter
appVersion: v0.15.1
sources:
Expand Down
20 changes: 20 additions & 0 deletions charts/prometheus-mysql-exporter/templates/prometheusrule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.prometheusRule.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ template "prometheus-mysql-exporter.fullname" . }}
{{- with .Values.prometheusRule.namespace }}
namespace: {{ . }}
{{- end }}
labels:
{{ include "prometheus-mysql-exporter.labels" . | indent 4 }}
{{- with .Values.prometheusRule.additionalLabels }}
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- with .Values.prometheusRule.rules }}
groups:
- name: {{ template "prometheus-mysql-exporter.name" $ }}
rules: {{ tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- end }}
20 changes: 20 additions & 0 deletions charts/prometheus-mysql-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,23 @@ cloudsqlproxy:
enabled: false
serviceAccountEmail: ""
extraArgs: ""

## Custom PrometheusRules to be defined
## The value is evaluated as a template, so, for example, the value can depend on .Release or .Chart
## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions
prometheusRule:
enabled: false
additionalLabels: {}
namespace: ""
rules:
[]
## These are just examples rules, please adapt them to your needs.
## Make sure to constraint the rules to the current service.
# - alert: MysqlDown
# expr: mysql_up == 0
# for: 5m
# labels:
# severity: critical
# annotations:
# summary: MySQL down (instance {{ $labels.instance }})
# description: "MySQL instance is down on {{ $labels.instance }}\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
23 changes: 23 additions & 0 deletions charts/prometheus-systemd-exporter/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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/
12 changes: 12 additions & 0 deletions charts/prometheus-systemd-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v2
name: prometheus-systemd-exporter
description: A Helm chart for prometheus systemd-exporter
type: application
version: 0.1.0
appVersion: "0.6.0"
home: https://github.com/prometheus-community/systemd_exporter
sources:
- https://github.com/prometheus-community/systemd_exporter
maintainers:
- name: capuche2412
email: [email protected]
42 changes: 42 additions & 0 deletions charts/prometheus-systemd-exporter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Prometheus Systemd Exporter

Prometheus exporter for systemd units, written in Go.

This chart bootstraps a prometheus [systemd exporter](https://github.com/prometheus-community/systemd_exporter) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

## Add Helm Chart Repository

```console
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
```

_See [`helm repo`](https://helm.sh/docs/helm/helm_repo/) for command documentation._

## Install Chart

```console
helm install [RELEASE_NAME] prometheus-community/prometheus-systemd-exporter
```

_See [configuration](#configuring) below._

_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._

## Uninstall Chart

```console
helm uninstall [RELEASE_NAME]
```

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

_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._

## Configuring

See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments, visit the chart's [values.yaml](./values.yaml), or run these configuration commands:

```console
helm show values prometheus-community/prometheus-systemd-exporter
```
Empty file.
132 changes: 132 additions & 0 deletions charts/prometheus-systemd-exporter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "prometheus-systemd-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 "prometheus-systemd-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 "prometheus-systemd-exporter.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "prometheus-systemd-exporter.labels" -}}
helm.sh/chart: {{ include "prometheus-systemd-exporter.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: metrics
app.kubernetes.io/part-of: {{ include "prometheus-systemd-exporter.name" . }}
{{ include "prometheus-systemd-exporter.selectorLabels" . }}
{{- with .Chart.AppVersion }}
app.kubernetes.io/version: {{ . | quote }}
{{- end }}
{{- with .Values.podLabels }}
{{ toYaml . }}
{{- end }}
{{- if .Values.releaseLabel }}
release: {{ .Release.Name }}
{{- end }}
{{- end }}

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


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

{{/*
The image to use
*/}}
{{- define "prometheus-systemd-exporter.image" -}}
{{- if .Values.image.sha }}
{{- fail "image.sha forbidden. Use image.digest instead" }}
{{- else if .Values.image.digest }}
{{- if .Values.global.imageRegistry }}
{{- printf "%s/%s:%s@%s" .Values.global.imageRegistry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) .Values.image.digest }}
{{- else }}
{{- printf "%s/%s:%s@%s" .Values.image.registry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) .Values.image.digest }}
{{- end }}
{{- else }}
{{- if .Values.global.imageRegistry }}
{{- printf "%s/%s:%s" .Values.global.imageRegistry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) }}
{{- else }}
{{- printf "%s/%s:%s" .Values.image.registry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
*/}}
{{- define "prometheus-systemd-exporter.namespace" -}}
{{- if .Values.namespaceOverride }}
{{- .Values.namespaceOverride }}
{{- else }}
{{- .Release.Namespace }}
{{- end }}
{{- end }}

{{/*
Create the namespace name of the service monitor
*/}}
{{- define "prometheus-systemd-exporter.monitor-namespace" -}}
{{- if .Values.namespaceOverride }}
{{- .Values.namespaceOverride }}
{{- else }}
{{- if .Values.prometheus.monitor.namespace }}
{{- .Values.prometheus.monitor.namespace }}
{{- else }}
{{- .Release.Namespace }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Formats imagePullSecrets. Input is (dict "Values" .Values "imagePullSecrets" .{specific imagePullSecrets})
*/}}
{{- define "prometheus-systemd-exporter.imagePullSecrets" -}}
{{- range (concat .Values.global.imagePullSecrets .imagePullSecrets) }}
{{- if eq (typeOf .) "map[string]interface {}" }}
- {{ toYaml . | trim }}
{{- else }}
- name: {{ . }}
{{- end }}
{{- end }}
{{- end -}}
Loading

0 comments on commit 1a46d5c

Please sign in to comment.