-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
310 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
62
charts/prometheus-statuspage-pusher/templates/_helpers.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
11
charts/prometheus-statuspage-pusher/templates/configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
78
charts/prometheus-statuspage-pusher/templates/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |