This tool sends an e-mail alert when there is a Kubernetes Job failure/success.
No extra setup required to deploy this tool on to your cluster, just apply below Kubernetes deployment manifest.
Uses InClusterConfig to access the Kubernetes API.
export namespace="foo" && export notification_level="failed" && export in_cluster="0" && export sender="[email protected]" && export sender_password="" && export receivers="[email protected], [email protected]" && export smtp_host="smtp.example.com" && export smtp_port="587" && go build -o herald && ./herald
Namespace scoped i.e., each namespace should have this deploy separately
apiVersion: v1
kind: Namespace
metadata:
name: foo
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: herald
namespace: foo
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: foo
name: job-reader
rules:
- apiGroups: ['batch']
resources:
- jobs
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: herald
namespace: foo
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: job-reader
subjects:
- kind: ServiceAccount
name: herald
namespace: foo
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: herald
namespace: foo
spec:
replicas: 1
selector:
matchLabels:
app: herald
template:
metadata:
labels:
app: herald
spec:
serviceAccountName: herald
containers:
- name: herald
image: aliaktas/herald:amd64
imagePullPolicy: Always
env:
- name: namespace
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: notification_level
value: "failed"
- name: in_cluster
value: "1"
- name: sender
value: "[email protected]"
- name: sender_password
value: ""
- name: receivers
value: "[email protected], [email protected]"
- name: smtp_host
value: "smtp.example.com"
- name: smtp_port
value: "587"
resources:
limits:
cpu: 500m
memory: 256Mi
requests:
cpu: 500m
memory: 128Mi
Apache 2.0. See LICENSE.
Content type
Image
Digest
sha256:44e90a56f…
Size
17.7 MB
Last updated
over 2 years ago
docker pull aliaktas/herald:amd64