This repository has been archived by the owner on Aug 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 355
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
180 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
requirements.lock |
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,3 @@ | ||
# Ignore common backup files | ||
*.swp | ||
*~ |
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,4 @@ | ||
apiVersion: v2 | ||
description: Kube event exporter helm chart | ||
name: kube-event-exporter | ||
version: 0.9 |
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,25 @@ | ||
|
||
## Kube Event Exporter | ||
|
||
This tool allows exporting the often missed Kubernetes events to various outputs so that they can be used for observability or alerting purposes. | ||
|
||
## Prerequisites | ||
|
||
- Kubernetes 1.14+ | ||
- Helm 3.2+ | ||
|
||
## Installing the Chart | ||
|
||
First, download the git repository. | ||
|
||
```shell | ||
$ helm install kubeevent -n monitoring ./charts/kube-event-exporter | ||
``` | ||
|
||
## Configuration | ||
The following tables lists the configurable parameters of the chart and their default values. | ||
|
||
| Parameter | Description | Default | | ||
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------| | ||
| imagePullSecrets | Image pull secrets. | [] | ||
| exporter.config | Config values for exporter | dump to stdout |
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,39 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "kubeevent.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 "kubeevent.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 "kubeevent.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Allow for the ability to override the release name used as a label in many places. | ||
*/}} | ||
{{- define "kubeevent.releaseLabel" -}} | ||
{{- .Values.releaseLabelOverride | default .Release.Name | trunc 63 -}} | ||
{{- 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,13 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: "{{ include "kubeevent.fullname" . }}-cfg" | ||
labels: | ||
app: {{ template "kubeevent.name" . }} | ||
chart: {{ template "kubeevent.chart" . }} | ||
release: {{ template "kubeevent.releaseLabel" . }} | ||
data: | ||
config.yaml: | | ||
{{- if .Values.exporter.config }} | ||
{{- toYaml .Values.exporter.config | nindent 4 }} | ||
{{- 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,47 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: "{{ include "kubeevent.fullname" . }}" | ||
labels: | ||
app: {{ template "kubeevent.name" . }} | ||
chart: {{ template "kubeevent.chart" . }} | ||
release: {{ template "kubeevent.releaseLabel" . }} | ||
{{- if .Values.exporter.labels }} | ||
{{ toYaml .Values.exporter.labels | indent 4 }} | ||
{{- end }} | ||
{{- if .Values.exporter.annotations }} | ||
annotations: | ||
{{ toYaml .Values.exporter.annotations | indent 4 }} | ||
{{- end }} | ||
spec: | ||
replicas: {{ toYaml .Values.exporter.replicaCount }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ template "kubeevent.name" . }} | ||
release: {{ template "kubeevent.releaseLabel" . }} | ||
version: v1 | ||
spec: | ||
serviceAccountName: "{{ include "kubeevent.fullname" . }}" | ||
{{- if .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{ toYaml .Values.imagePullSecrets | indent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: event-exporter | ||
image: "{{ .Values.exporter.repository }}:{{ .Values.exporter.tag }}" | ||
imagePullPolicy: {{ .Values.exporter.imagePullPolicy }} | ||
args: | ||
- -conf=/data/config.yaml | ||
volumeMounts: | ||
- mountPath: /data | ||
name: cfg | ||
volumes: | ||
- name: cfg | ||
configMap: | ||
name: "{{ include "kubeevent.fullname" . }}-cfg" | ||
selector: | ||
matchLabels: | ||
app: {{ template "kubeevent.name" . }} | ||
release: {{ template "kubeevent.releaseLabel" . }} | ||
version: v1 |
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,26 @@ | ||
|
||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: "{{ include "kubeevent.fullname" . }}" | ||
labels: | ||
app: {{ template "kubeevent.name" . }} | ||
chart: {{ template "kubeevent.chart" . }} | ||
release: {{ template "kubeevent.releaseLabel" . }} | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: "{{ include "kubeevent.fullname" . }}" | ||
labels: | ||
app: {{ template "kubeevent.name" . }} | ||
chart: {{ template "kubeevent.chart" . }} | ||
release: {{ template "kubeevent.releaseLabel" . }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: view | ||
subjects: | ||
- kind: ServiceAccount | ||
namespace: {{ .Release.Namespace }} | ||
name: "{{ include "kubeevent.fullname" . }}" |
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,22 @@ | ||
|
||
exporter: | ||
annotations: {} | ||
replicaCount: 1 | ||
repository: opsgenie/kubernetes-event-exporter | ||
tag: 0.9 | ||
imagePullPolicy: IfNotPresent | ||
config: | ||
logLevel: error | ||
logFormat: json | ||
route: | ||
routes: | ||
- match: | ||
- receiver: "dump" | ||
receivers: | ||
- name: "dump" | ||
file: | ||
path: "/dev/stdout" | ||
|
||
## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ | ||
imagePullSecrets: [] | ||
# - name: secretName |