Skip to content

Commit c17dae4

Browse files
committed
Release Statuspage pusher chart.
1 parent 055785f commit c17dae4

File tree

9 files changed

+310
-0
lines changed

9 files changed

+310
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This repository contains [Helm](https://helm.sh) charts for various projects
1111
- [Oauth2-proxy](https://github.com/Whyeasy/helm-charts/tree/master/charts/oauth2-proxy)
1212
- [Osiris](https://github.com/whyeasy/helm-charts/tree/master/charts/osiris)
1313
- [Prometheus MongoDb Exporter](https://github.com/whyeasy/helm-charts/tree/master/charts/prometheus-mongodb-exporter)
14+
- [Prometheus Statuspage Pusher](https://github.com/whyeasy/helm-charts/tree/master/charts/prometheus-statuspage-pusher)
1415
- [Stackdriver-exporter](https://github.com/Whyeasy/helm-charts/tree/master/charts/stackdriver-exporter) -- Deprecated
1516
- [Sonarcloud-exporter](https://github.com/Whyeasy/helm-charts/tree/master/charts/sonarcloud-exporter)
1617
- [Version-checker](https://github.com/Whyeasy/helm-charts/tree/master/charts/version-checker)
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: prometheus-statuspage-pusher
3+
description: A helm chart to deploy [prometheus-statuspage-pusher](https://github.com/Whyeasy/prometheus-statuspage-pusher).
4+
type: application
5+
version: 0.1.0
6+
appVersion: 0.1.1
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# prometheus-statuspage-pusher
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) ![AppVersion: 0.1.1](https://img.shields.io/badge/AppVersion-0.1.1-informational?style=flat-square)
4+
5+
A helm chart to deploy [prometheus-statuspage-pusher](https://github.com/Whyeasy/prometheus-statuspage-pusher).
6+
7+
## Values
8+
9+
| Key | Type | Default | Description |
10+
|-----|------|---------|-------------|
11+
| affinity | object | `{}` | Node/pod affinities |
12+
| annotations | object | `{}` | Annotations to be added to the pods |
13+
| env | list | `[]` | environment variables for the container |
14+
| envFrom | list | `[]` | environment variable sources for the container |
15+
| extraVolumeMounts | list | `[]` | additional volume mounts |
16+
| extraVolumes | list | `[]` | additional volumes |
17+
| fullnameOverride | string | `""` | full name of the chart. |
18+
| image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
19+
| image.repository | string | `"whyeasy/prometheus-statuspage-pusher"` | image repository |
20+
| image.tag | string | `"0.1.1"` | image tag |
21+
| imagePullSecrets | list | `[]` | image pull secret for private images |
22+
| nameOverride | string | `""` | override name of the chart |
23+
| nodeSelector | object | `{}` | node for scheduler pod assignment |
24+
| podSecurityContext | object | `{}` | Add security context to pods |
25+
| prometheus.metrics | list | `["metricID: prometheus-expression","metricID2: prometheus-expression2"]` | Entries of metricsID and Prometheus expression to send to Statuspage |
26+
| prometheus.url | string | `"http://localhost:9091/prometheus"` | URL of Prometheus API |
27+
| resources | object | `{}` | custom resource configuration |
28+
| securityContext | object | `{}` | Add security context to deployment |
29+
| statuspage.id | int | `0` | Statuspage ID |
30+
| statuspage.pushInterval | string | `"30s"` | Metric push interval to Statuspage |
31+
| statuspage.url | string | `"https://api.statuspage.io"` | statuspage URL |
32+
| strategy.type | string | `"RollingUpdate"` | Strategy for deploying containers |
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{ template "chart.header" . }}
2+
3+
{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}
4+
5+
{{ template "chart.description" . }}
6+
7+
{{ template "chart.sourcesSection" . }}
8+
9+
{{ template "chart.requirementsSection" . }}
10+
11+
{{ template "chart.valuesSection" . }}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "prometheus-statuspage-pusher.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 "prometheus-statuspage-pusher.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 "prometheus-statuspage-pusher.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "prometheus-statuspage-pusher.labels" -}}
37+
helm.sh/chart: {{ include "prometheus-statuspage-pusher.chart" . }}
38+
{{ include "prometheus-statuspage-pusher.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 "prometheus-statuspage-pusher.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "prometheus-statuspage-pusher.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 "prometheus-statuspage-pusher.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "prometheus-statuspage-pusher.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "prometheus-statuspage-pusher.fullname" . }}
5+
labels:
6+
{{- include "prometheus-statuspage-pusher.labels" . | nindent 4 }}
7+
data:
8+
queries.yaml: |
9+
{{- range .Values.prometheus.metrics }}
10+
{{ . }}
11+
{{- end }}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "prometheus-statuspage-pusher.fullname" . }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
{{- include "prometheus-statuspage-pusher.labels" . | nindent 4 }}
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
{{- include "prometheus-statuspage-pusher.selectorLabels" . | nindent 6 }}
13+
{{- with .Values.strategy }}
14+
strategy: {{ toYaml . | nindent 4 }}
15+
{{- end }}
16+
template:
17+
metadata:
18+
labels:
19+
{{- include "prometheus-statuspage-pusher.selectorLabels" . | nindent 8 }}
20+
spec:
21+
{{- with .Values.imagePullSecrets }}
22+
imagePullSecrets:
23+
{{- toYaml . | nindent 8 }}
24+
{{- end }}
25+
securityContext:
26+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
27+
containers:
28+
- name: {{ .Chart.Name }}
29+
securityContext:
30+
{{- toYaml .Values.securityContext | nindent 12 }}
31+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
32+
imagePullPolicy: {{ .Values.image.pullPolicy }}
33+
resources:
34+
{{- toYaml .Values.resources | nindent 12 }}
35+
args:
36+
- -c
37+
- "/etc/statuspage-pusher/queries.yaml"
38+
- -i
39+
- {{ .Values.statuspage.pushInterval | quote }}
40+
- -si
41+
- {{ .Values.statuspage.id | quote }}
42+
- -su
43+
- {{ .Values.statuspage.url | quote }}
44+
- -pu
45+
- {{ .Values.prometheus.url | quote }}
46+
{{- with .Values.env }}
47+
env:
48+
{{- toYaml . | nindent 12 }}
49+
{{- end }}
50+
{{- with .Values.envFrom }}
51+
envFrom:
52+
{{- toYaml . | nindent 12 }}
53+
{{- end }}
54+
volumeMounts:
55+
- name: queries
56+
mountPath: /etc/statuspage-pusher/
57+
{{- with .Values.extraVolumeMounts }}
58+
{{- toYaml . | nindent 12 }}
59+
{{- end }}
60+
{{- with .Values.nodeSelector }}
61+
nodeSelector:
62+
{{- toYaml . | nindent 8 }}
63+
{{- end }}
64+
{{- with .Values.affinity }}
65+
affinity:
66+
{{- toYaml . | nindent 8 }}
67+
{{- end }}
68+
{{- with .Values.tolerations }}
69+
tolerations:
70+
{{- toYaml . | nindent 8 }}
71+
{{- end }}
72+
volumes:
73+
- name: queries
74+
configMap:
75+
name: {{ include "prometheus-statuspage-pusher.fullname" . }}
76+
{{- with .Values.extraVolumes }}
77+
{{- toYaml . | nindent 8 }}
78+
{{- end }}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
image:
2+
# -- image repository
3+
repository: whyeasy/prometheus-statuspage-pusher
4+
# -- image tag
5+
tag: 0.1.1
6+
# -- image pull policy
7+
pullPolicy: IfNotPresent
8+
9+
10+
statuspage:
11+
# -- Metric push interval to Statuspage
12+
pushInterval: 30s
13+
# -- Statuspage ID
14+
id: 0
15+
# -- statuspage URL
16+
url: https://api.statuspage.io
17+
18+
prometheus:
19+
# -- URL of Prometheus API
20+
url: http://localhost:9091/prometheus
21+
# -- Entries of metricsID and Prometheus expression to send to Statuspage
22+
metrics:
23+
- "metricID: prometheus-expression"
24+
- "metricID2: prometheus-expression2"
25+
# <statuspage-MetricsID> : <prometheus_expression>
26+
# abcdef: avg(up{job="web"})
27+
28+
# -- image pull secret for private images
29+
imagePullSecrets: []
30+
# -- override name of the chart
31+
nameOverride: ""
32+
# -- full name of the chart.
33+
fullnameOverride: ""
34+
35+
# -- custom resource configuration
36+
resources: {}
37+
# limits:
38+
# cpu: 100m
39+
# memory: 128Mi
40+
# requests:
41+
# cpu: 100m
42+
# memory: 128Mi
43+
44+
# -- Add security context to pods
45+
podSecurityContext: {}
46+
# fsGroup: 2000
47+
48+
# -- Add security context to deployment
49+
securityContext: {}
50+
# capabilities:
51+
# drop:
52+
# - ALL
53+
# readOnlyRootFilesystem: true
54+
# runAsNonRoot: true
55+
# runAsUser: 1000
56+
57+
# -- node for scheduler pod assignment
58+
nodeSelector: {}
59+
60+
# -- Node/pod affinities
61+
affinity: {}
62+
63+
# -- Annotations to be added to the pods
64+
annotations: {}
65+
66+
# -- additional volume mounts
67+
extraVolumeMounts: []
68+
# - name: some
69+
# mountPath: /volume
70+
71+
# -- additional volumes
72+
extraVolumes: []
73+
# - name: tmp
74+
# emptyDir: {}
75+
76+
# -- environment variables for the container
77+
env: []
78+
79+
# -- environment variable sources for the container
80+
envFrom: []
81+
# - configMapRef:
82+
# name: pusher-cm
83+
84+
strategy:
85+
# -- Strategy for deploying containers
86+
type: RollingUpdate

0 commit comments

Comments
 (0)