Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit 8100a27

Browse files
authored
Merge pull request #108 from ccremer/stiebeleltron-exporter
Add stiebeleltron-exporter chart
2 parents b28f678 + 19f9ee6 commit 8100a27

File tree

14 files changed

+633
-0
lines changed

14 files changed

+633
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
| [![chart downloads](https://img.shields.io/github/downloads/ccremer/charts/fronius-stack-0.1.4/total)](https://github.com/ccremer/charts/releases/tag/fronius-stack-0.1.4) | [fronius-stack](charts/fronius-stack/README.md) |
1616
| [![chart downloads](https://img.shields.io/github/downloads/ccremer/charts/kubernetes-zfs-provisioner-1.1.2/total)](https://github.com/ccremer/charts/releases/tag/kubernetes-zfs-provisioner-1.1.2) | [kubernetes-zfs-provisioner](charts/kubernetes-zfs-provisioner/README.md) |
1717
| [![chart downloads](https://img.shields.io/github/downloads/ccremer/charts/samba-0.1.1/total)](https://github.com/ccremer/charts/releases/tag/samba-0.1.1) | [samba](charts/samba/README.md) |
18+
| [![chart downloads](https://img.shields.io/github/downloads/ccremer/charts/stiebeleltron-exporter-0.1.0/total)](https://github.com/ccremer/charts/releases/tag/stiebeleltron-exporter-0.1.0) | [stiebeleltron-exporter](charts/stiebeleltron-exporter/README.md) |
1819
| [![chart downloads](https://img.shields.io/github/downloads/ccremer/charts/znapzend-0.5.4/total)](https://github.com/ccremer/charts/releases/tag/znapzend-0.5.4) | [znapzend](charts/znapzend/README.md) |
1920

2021
## Development
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: v2
2+
name: stiebeleltron-exporter
3+
description: Prometheus Exporter for Stiebel Eltron heat pump ISG
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
#appVersion: "1.16.0"
25+
26+
keywords:
27+
- stiebel eltron
28+
- isg
29+
- heat pump
30+
- exporter
31+
- prometheus
32+
icon: https://www.stiebel-eltron.com/apps/ste/docroot/images/single/logo-stiebel-eltron-red-black.svg
33+
home: https://github.com/ccremer/stiebeleltron-exporter
34+
sources:
35+
- https://github.com/ccremer/stiebeleltron-exporter
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
## Prometheus Operator
3+
4+
This chart features templates for [Prometheus Operator][prometheus-operator] if desired.
5+
If you'd like to add additional Prometheus labels to all metrics, you could make use of relabelings:
6+
7+
```yaml
8+
serviceMonitor:
9+
enabled: true
10+
metricRelabelings:
11+
- targetLabel: site
12+
replacement: my-home
13+
```
14+
15+
<!---
16+
Common/Useful Link references from values.yaml
17+
-->
18+
[resource-units]: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes
19+
[prometheus-operator]: https://github.com/coreos/prometheus-operator
20+
[prom-relabel-config]: https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# stiebeleltron-exporter
2+
3+
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
4+
5+
Prometheus Exporter for Stiebel Eltron heat pump ISG
6+
7+
**Homepage:** <https://github.com/ccremer/stiebeleltron-exporter>
8+
9+
## Installation
10+
11+
```bash
12+
helm repo add ccremer https://ccremer.github.io/charts
13+
helm install stiebeleltron-exporter ccremer/stiebeleltron-exporter
14+
```
15+
16+
## Prometheus Operator
17+
18+
This chart features templates for [Prometheus Operator][prometheus-operator] if desired.
19+
If you'd like to add additional Prometheus labels to all metrics, you could make use of relabelings:
20+
21+
```yaml
22+
serviceMonitor:
23+
enabled: true
24+
metricRelabelings:
25+
- targetLabel: site
26+
replacement: my-home
27+
```
28+
29+
<!---
30+
Common/Useful Link references from values.yaml
31+
-->
32+
[resource-units]: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes
33+
[prometheus-operator]: https://github.com/coreos/prometheus-operator
34+
[prom-relabel-config]: https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
35+
36+
## Source Code
37+
38+
* <https://github.com/ccremer/stiebeleltron-exporter>
39+
40+
## Values
41+
42+
| Key | Type | Default | Description |
43+
|-----|------|---------|-------------|
44+
| affinity | object | `{}` | |
45+
| exporter.additionalArgs | list | `[]` | Provide additional CLI flags via string array |
46+
| exporter.isgUrl | string | `"http://isg.ip.or.hostname"` | Target URL of Stiebel Eltron ISG device. **Required** |
47+
| exporter.timeoutSeconds | int | `5` | Time after which collecting may time out. Should not be higher than the Prometheus scrape interval. |
48+
| fullnameOverride | string | `""` | |
49+
| hostAliases | object | `{}` | A dict with `{ip, hostnames array}` to configure custom entries in /etc/hosts. See [values.yaml](./values.yaml) for an example. |
50+
| image.pullPolicy | string | `"IfNotPresent"` | |
51+
| image.registry | string | `"ghcr.io"` | Container image registry |
52+
| image.repository | string | `"ccremer/stiebeleltron-exporter"` | Location of the container image |
53+
| image.tag | string | `"v0.1.0"` | Container image tag |
54+
| imagePullSecrets | list | `[]` | List of image pull secrets if you use a privately hosted image |
55+
| ingress.annotations | object | `{}` | Additional annotations for the Ingress object |
56+
| ingress.enabled | bool | `false` | Useful if your Prometheus is outside of the cluster |
57+
| ingress.hosts | list | `[]` | See Kubernetes Docs for a guide to setup Ingress hosts |
58+
| ingress.tls | list | `[]` | See Kubernetes Docs for a guide to setup TLS on Ingress |
59+
| nameOverride | string | `""` | |
60+
| nodeSelector | object | `{}` | |
61+
| podAnnotations | object | `{}` | |
62+
| podSecurityContext | object | `{}` | |
63+
| replicaCount | int | `1` | Usually `1` is fine |
64+
| resources.limits.memory | string | `"64Mi"` | |
65+
| resources.requests.cpu | string | `"20m"` | |
66+
| resources.requests.memory | string | `"32Mi"` | |
67+
| securityContext | object | `{}` | |
68+
| service.nodePort | int | `0` | Node port number if `type` is `NodePort` |
69+
| service.port | int | `8080` | Service port number |
70+
| service.type | string | `"ClusterIP"` | Service type |
71+
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
72+
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
73+
| 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 |
74+
| serviceMonitor.additionalLabels | object | `{}` | Add custom labels to the ServiceMonitor object |
75+
| serviceMonitor.enabled | bool | `false` | Deploy a ServiceMonitor object for Prometheus. Requires an installed [Prometheus Operator][prometheus-operator]. |
76+
| serviceMonitor.metricRelabelings | list | `[]` | Add relabeling configs before ingestion, see [RelabelConfig][prom-relabel-config]. |
77+
| serviceMonitor.namespace | string | `""` | Namespace in which to deploy the ServiceMonitor, defaults to release namespace. |
78+
| serviceMonitor.scrapeInterval | string | `""` | Override default scrape interval from Prometheus |
79+
| telegraf.enabled | bool | `false` | Whether to enable Telegraf sidecar for Influxdb |
80+
| telegraf.globalTags | object | `{}` | A dict with `key: value` to add to `global_tags` config |
81+
| telegraf.image.registry | string | `"docker.io"` | |
82+
| telegraf.image.repository | string | `"library/telegraf"` | Telegraf image location |
83+
| telegraf.image.tag | string | `"1.20-alpine"` | Telegraf image tag |
84+
| telegraf.influxdb.bucket | string | `"stiebeleltron"` | Bucket to write metrics into |
85+
| telegraf.influxdb.organization | string | `"stiebeleltron"` | Organization where the bucket belongs to |
86+
| telegraf.influxdb.token | string | `""` | Token used to authenticate to InfluxDB |
87+
| telegraf.influxdb.url | string | `"http://influxdb2"` | URL of an InfluxDB 2 instance |
88+
| telegraf.interval | string | `"30s"` | Go-style interval in which metrics are pushed to InfluxDB |
89+
| tolerations | list | `[]` | |
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
1. Get the application URL by running these commands:
2+
{{- if .Values.ingress.enabled }}
3+
{{- range $host := .Values.ingress.hosts }}
4+
{{- range .paths }}
5+
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
6+
{{- end }}
7+
{{- end }}
8+
{{- else if contains "NodePort" .Values.service.type }}
9+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "stiebeleltron-exporter.fullname" . }})
10+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11+
echo http://$NODE_IP:$NODE_PORT
12+
{{- else if contains "LoadBalancer" .Values.service.type }}
13+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "stiebeleltron-exporter.fullname" . }}'
15+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "stiebeleltron-exporter.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
16+
echo http://$SERVICE_IP:{{ .Values.service.port }}
17+
{{- else if contains "ClusterIP" .Values.service.type }}
18+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "stiebeleltron-exporter.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19+
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
20+
echo "Visit http://127.0.0.1:8080 to use your application"
21+
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
22+
{{- end }}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "stiebeleltron-exporter.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "stiebeleltron-exporter.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "stiebeleltron-exporter.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "stiebeleltron-exporter.labels" -}}
37+
helm.sh/chart: {{ include "stiebeleltron-exporter.chart" . }}
38+
{{ include "stiebeleltron-exporter.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "stiebeleltron-exporter.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "stiebeleltron-exporter.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "stiebeleltron-exporter.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "stiebeleltron-exporter.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
63+
64+
{{/*
65+
Container images
66+
*/}}
67+
{{- define "stiebeleltron-exporter.image" -}}
68+
{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}
69+
{{- end }}
70+
{{- define "stiebeleltron-exporter.telegrafImage" -}}
71+
{{ .Values.telegraf.image.registry }}/{{ .Values.telegraf.image.repository }}:{{ .Values.telegraf.image.tag }}
72+
{{- end }}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "stiebeleltron-exporter.fullname" . }}
5+
labels:
6+
{{- include "stiebeleltron-exporter.labels" . | nindent 4 }}
7+
spec:
8+
replicas: {{ .Values.replicaCount }}
9+
selector:
10+
matchLabels:
11+
{{- include "stiebeleltron-exporter.selectorLabels" . | nindent 6 }}
12+
template:
13+
metadata:
14+
{{- if or .Values.telegraf.enabled .Values.podAnnotations }}
15+
annotations:
16+
{{- if .Values.telegraf.enabled }}
17+
app.kubernetes.io/checksum: telegraf={{ include (print $.Template.BasePath "/telegraf-secret.yaml") . | sha256sum }}
18+
{{- end }}
19+
{{- with .Values.podAnnotations }}
20+
{{- toYaml . | nindent 8 }}
21+
{{- end }}
22+
{{- end }}
23+
labels:
24+
{{- include "stiebeleltron-exporter.selectorLabels" . | nindent 8 }}
25+
spec:
26+
{{- with .Values.imagePullSecrets }}
27+
imagePullSecrets:
28+
{{- toYaml . | nindent 8 }}
29+
{{- end }}
30+
serviceAccountName: {{ include "stiebeleltron-exporter.serviceAccountName" . }}
31+
securityContext:
32+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
33+
containers:
34+
- name: exporter
35+
securityContext:
36+
{{- toYaml .Values.securityContext | nindent 12 }}
37+
image: {{ include "stiebeleltron-exporter.image" . }}
38+
imagePullPolicy: {{ .Values.image.pullPolicy }}
39+
args:
40+
- --isg.url={{ .Values.exporter.isgUrl }}
41+
- --isg.timeout={{ .Values.exporter.timeoutSeconds }}
42+
{{- range .Values.exporter.additionalArgs }}
43+
- {{ . }}
44+
{{- end }}
45+
ports:
46+
- name: http
47+
containerPort: 8080
48+
protocol: TCP
49+
livenessProbe:
50+
httpGet:
51+
path: /liveness
52+
port: http
53+
resources:
54+
{{- toYaml .Values.resources | nindent 12 }}
55+
{{- if .Values.telegraf.enabled }}
56+
- name: telegraf
57+
image: {{ include "stiebeleltron-exporter.telegrafImage" . }}
58+
resources:
59+
limits:
60+
cpu: 200m
61+
memory: 200Mi
62+
requests:
63+
cpu: 10m
64+
memory: 10Mi
65+
volumeMounts:
66+
- name: telegraf-config
67+
mountPath: /etc/telegraf
68+
volumes:
69+
- name: telegraf-config
70+
secret:
71+
secretName: {{ template "stiebeleltron-exporter.fullname" . }}
72+
defaultMode: 420
73+
{{- end }}
74+
{{- with .Values.hostAliases }}
75+
hostAliases:
76+
{{- range $ip, $hostnames := . }}
77+
- ip: {{ $ip }}
78+
hostnames:
79+
{{- range . }}
80+
- {{ . }}
81+
{{- end }}
82+
{{- end }}
83+
{{- end }}
84+
{{- with .Values.nodeSelector }}
85+
nodeSelector:
86+
{{- toYaml . | nindent 8 }}
87+
{{- end }}
88+
{{- with .Values.affinity }}
89+
affinity:
90+
{{- toYaml . | nindent 8 }}
91+
{{- end }}
92+
{{- with .Values.tolerations }}
93+
tolerations:
94+
{{- toYaml . | nindent 8 }}
95+
{{- end }}

0 commit comments

Comments
 (0)