Skip to content

Commit

Permalink
Release Statuspage pusher chart.
Browse files Browse the repository at this point in the history
  • Loading branch information
Whyeasy committed Mar 8, 2021
1 parent 055785f commit c17dae4
Show file tree
Hide file tree
Showing 9 changed files with 310 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This repository contains [Helm](https://helm.sh) charts for various projects
- [Oauth2-proxy](https://github.com/Whyeasy/helm-charts/tree/master/charts/oauth2-proxy)
- [Osiris](https://github.com/whyeasy/helm-charts/tree/master/charts/osiris)
- [Prometheus MongoDb Exporter](https://github.com/whyeasy/helm-charts/tree/master/charts/prometheus-mongodb-exporter)
- [Prometheus Statuspage Pusher](https://github.com/whyeasy/helm-charts/tree/master/charts/prometheus-statuspage-pusher)
- [Stackdriver-exporter](https://github.com/Whyeasy/helm-charts/tree/master/charts/stackdriver-exporter) -- Deprecated
- [Sonarcloud-exporter](https://github.com/Whyeasy/helm-charts/tree/master/charts/sonarcloud-exporter)
- [Version-checker](https://github.com/Whyeasy/helm-charts/tree/master/charts/version-checker)
Expand Down
23 changes: 23 additions & 0 deletions charts/prometheus-statuspage-pusher/.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/
6 changes: 6 additions & 0 deletions charts/prometheus-statuspage-pusher/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: prometheus-statuspage-pusher
description: A helm chart to deploy [prometheus-statuspage-pusher](https://github.com/Whyeasy/prometheus-statuspage-pusher).
type: application
version: 0.1.0
appVersion: 0.1.1
32 changes: 32 additions & 0 deletions charts/prometheus-statuspage-pusher/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# prometheus-statuspage-pusher

![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)

A helm chart to deploy [prometheus-statuspage-pusher](https://github.com/Whyeasy/prometheus-statuspage-pusher).

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | Node/pod affinities |
| annotations | object | `{}` | Annotations to be added to the pods |
| env | list | `[]` | environment variables for the container |
| envFrom | list | `[]` | environment variable sources for the container |
| extraVolumeMounts | list | `[]` | additional volume mounts |
| extraVolumes | list | `[]` | additional volumes |
| fullnameOverride | string | `""` | full name of the chart. |
| image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
| image.repository | string | `"whyeasy/prometheus-statuspage-pusher"` | image repository |
| image.tag | string | `"0.1.1"` | image tag |
| imagePullSecrets | list | `[]` | image pull secret for private images |
| nameOverride | string | `""` | override name of the chart |
| nodeSelector | object | `{}` | node for scheduler pod assignment |
| podSecurityContext | object | `{}` | Add security context to pods |
| prometheus.metrics | list | `["metricID: prometheus-expression","metricID2: prometheus-expression2"]` | Entries of metricsID and Prometheus expression to send to Statuspage |
| prometheus.url | string | `"http://localhost:9091/prometheus"` | URL of Prometheus API |
| resources | object | `{}` | custom resource configuration |
| securityContext | object | `{}` | Add security context to deployment |
| statuspage.id | int | `0` | Statuspage ID |
| statuspage.pushInterval | string | `"30s"` | Metric push interval to Statuspage |
| statuspage.url | string | `"https://api.statuspage.io"` | statuspage URL |
| strategy.type | string | `"RollingUpdate"` | Strategy for deploying containers |
11 changes: 11 additions & 0 deletions charts/prometheus-statuspage-pusher/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{ template "chart.header" . }}

{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}

{{ template "chart.description" . }}

{{ template "chart.sourcesSection" . }}

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}
62 changes: 62 additions & 0 deletions charts/prometheus-statuspage-pusher/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "prometheus-statuspage-pusher.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-statuspage-pusher.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-statuspage-pusher.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
Create the name of the service account to use
*/}}
{{- define "prometheus-statuspage-pusher.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "prometheus-statuspage-pusher.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
11 changes: 11 additions & 0 deletions charts/prometheus-statuspage-pusher/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "prometheus-statuspage-pusher.fullname" . }}
labels:
{{- include "prometheus-statuspage-pusher.labels" . | nindent 4 }}
data:
queries.yaml: |
{{- range .Values.prometheus.metrics }}
{{ . }}
{{- end }}
78 changes: 78 additions & 0 deletions charts/prometheus-statuspage-pusher/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "prometheus-statuspage-pusher.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "prometheus-statuspage-pusher.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "prometheus-statuspage-pusher.selectorLabels" . | nindent 6 }}
{{- with .Values.strategy }}
strategy: {{ toYaml . | nindent 4 }}
{{- end }}
template:
metadata:
labels:
{{- include "prometheus-statuspage-pusher.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
args:
- -c
- "/etc/statuspage-pusher/queries.yaml"
- -i
- {{ .Values.statuspage.pushInterval | quote }}
- -si
- {{ .Values.statuspage.id | quote }}
- -su
- {{ .Values.statuspage.url | quote }}
- -pu
- {{ .Values.prometheus.url | quote }}
{{- with .Values.env }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.envFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: queries
mountPath: /etc/statuspage-pusher/
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: queries
configMap:
name: {{ include "prometheus-statuspage-pusher.fullname" . }}
{{- with .Values.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
86 changes: 86 additions & 0 deletions charts/prometheus-statuspage-pusher/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
image:
# -- image repository
repository: whyeasy/prometheus-statuspage-pusher
# -- image tag
tag: 0.1.1
# -- image pull policy
pullPolicy: IfNotPresent


statuspage:
# -- Metric push interval to Statuspage
pushInterval: 30s
# -- Statuspage ID
id: 0
# -- statuspage URL
url: https://api.statuspage.io

prometheus:
# -- URL of Prometheus API
url: http://localhost:9091/prometheus
# -- Entries of metricsID and Prometheus expression to send to Statuspage
metrics:
- "metricID: prometheus-expression"
- "metricID2: prometheus-expression2"
# <statuspage-MetricsID> : <prometheus_expression>
# abcdef: avg(up{job="web"})

# -- image pull secret for private images
imagePullSecrets: []
# -- override name of the chart
nameOverride: ""
# -- full name of the chart.
fullnameOverride: ""

# -- custom resource configuration
resources: {}
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

# -- Add security context to pods
podSecurityContext: {}
# fsGroup: 2000

# -- Add security context to deployment
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

# -- node for scheduler pod assignment
nodeSelector: {}

# -- Node/pod affinities
affinity: {}

# -- Annotations to be added to the pods
annotations: {}

# -- additional volume mounts
extraVolumeMounts: []
# - name: some
# mountPath: /volume

# -- additional volumes
extraVolumes: []
# - name: tmp
# emptyDir: {}

# -- environment variables for the container
env: []

# -- environment variable sources for the container
envFrom: []
# - configMapRef:
# name: pusher-cm

strategy:
# -- Strategy for deploying containers
type: RollingUpdate

0 comments on commit c17dae4

Please sign in to comment.