In diesem Artikel beschreibe ich kurz, wie wir Alerta innerhalb eines Kubernetes-Clusters installieren können. Dazu findest du unten die Kubernetes Deployment Manifestdatei.
Zuerst muss die deployment.yml erzeugt werden. Diese sieht in meiner Umgebung wie folgt aus:
apiVersion: apps/v1
kind: Deployment
metadata:
name: alerta
namespace: monitoring
annotations:
author: Phillip Unzen<mail@phillipunzen.de>
spec:
replicas: 1
selector:
matchLabels:
app: alerta
template:
metadata:
labels:
app: alerta
annotations:
author: Phillip Unzen<mail@phillipunzen.de>
spec:
containers:
- name: alerta
image: alerta/alerta-web:latest
env:
- name: DATABASE_URL
value: "postgres://alerta:<Passwort>@<DB-IP>:5432/monitoring_alerta"
- name: ADMIN_PASSWORD
value: "<Passwort>"
- name: ADMIN_USERS
value: "admin"
- name: ADMIN_KEY
value: "deinapikey"
- name: DEBUG
value: "1"
- name: PLUGINS
value: "reject,heartbeat,blackout,normalise,core,grafana,prometheus"
ports:
- name: http
containerPort: 8080
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 10
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 10
Um den Pod jetzt zu starten, führe den folgenden Befehl aus:
kubectl apply -f deployment.yml