Skip to content

Commit

Permalink
helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
WakeupTsai committed Sep 19, 2018
1 parent b89a294 commit 7096da9
Show file tree
Hide file tree
Showing 15 changed files with 634 additions and 14 deletions.
21 changes: 21 additions & 0 deletions deploy/helm/apps/charts/prometheus/charts/alertmanager/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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
*~
# Various IDEs
.project
.idea/
*.tmproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: alertmanager
version: 0.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: alertmanager-config
namespace: vortex
data:
alertmanager.yml: |-
global:
smtp_smarthost: '{{ .Values.config.smtpHost }}'
smtp_from: '{{ .Values.config.smtpFrom }}'
smtp_auth_username: '{{ .Values.config.smtpUsername }}'
smtp_auth_password: '{{ .Values.config.smtpPassword }}'
route:
group_by: ['admin', 'email_to']
receiver: admin
routes:
- match:
admin: true
receiver: admin
- match:
admin: false
receiver: email_router
receivers:
- name: admin
email_configs:
- to: "{{ .Values.config.adminEmail }}"
headers: { Subject: "[WARN] Alert Email From Vortex" }
html: '{{ "{{" }} template "email.html" . {{ "}}" }}'
- name: email_router
email_configs:
- to: "{{ "{{" }} .GroupLabels.email_to {{ "}}" }}@gmail.com"
headers: { Subject: "[WARN] Alert Email From Vortex" }
html: '{{ "{{" }} template "email.html" . {{ "}}" }}'
templates:
- '/etc/email-template/email.tmpl'
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: alertmanager
namespace: vortex
labels:
app: alertmanager
spec:
replicas: 1
template:
metadata:
labels:
app: alertmanager
spec:
containers:
- name: prometheus-alertmanager
image: prom/alertmanager:{{ .Values.controller.imageTag }}
imagePullPolicy: "IfNotPresent"
args:
- --config.file=/etc/config/alertmanager.yml
- --storage.path=/data
- --web.external-url=/
ports:
- containerPort: 9093
readinessProbe:
httpGet:
path: /#/status
port: 9093
initialDelaySeconds: 30
timeoutSeconds: 30
volumeMounts:
- name: config-volume
mountPath: /etc/config
- name: storage-volume
mountPath: "/data"
subPath: ""
- name: email-template
mountPath: /etc/email-template
resources:
limits:
cpu: 10m
memory: 50Mi
requests:
cpu: 10m
memory: 50Mi
- name: prometheus-alertmanager-configmap-reload
image: "jimmidyson/configmap-reload:v0.1"
imagePullPolicy: "IfNotPresent"
args:
- --volume-dir=/etc/config
- --webhook-url=http://localhost:9093/-/reload
volumeMounts:
- name: config-volume
mountPath: /etc/config
readOnly: true
resources:
requests:
cpu: {{ .Values.controller.cpu }}
volumes:
- name: storage-volume
emptyDir: {}
- name: config-volume
configMap:
name: alertmanager-config
- name: email-template
configMap:
name: alertmanager-email-template
Loading

0 comments on commit 7096da9

Please sign in to comment.