Skip to content

Commit fd434f7

Browse files
Merge pull request #1 from RedesignScience/chart
Chart
2 parents f4b7ad9 + 627dfe0 commit fd434f7

File tree

11 files changed

+170
-112
lines changed

11 files changed

+170
-112
lines changed

.github/workflows/release.yml

-45
This file was deleted.

.github/workflows/test.yml

-22
This file was deleted.

charts/kubernetes-event-exporter/Chart.yaml

+2-11
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@ apiVersion: v2
22
name: kubernetes-event-exporter
33
description: Export Kubernetes events to multiple destinations with routing and filtering
44
type: application
5-
6-
# This is the chart version. This version number should be incremented each time you make changes
7-
# to the chart and its templates, including the app version.
8-
# Versions are expected to follow Semantic Versioning (https://semver.org/)
9-
version: 0.1.0
10-
11-
# This is the version number of the application being deployed. This version number should be
12-
# incremented each time you make changes to the application. Versions are not expected to
13-
# follow Semantic Versioning. They should reflect the version the application is using.
14-
# It is recommended to use it with quotes.
15-
appVersion: "1.16.0"
5+
version: 0.2.0
6+
appVersion: "v1.1"
167
home: https://github.com/resmoio/kubernetes-event-exporter

charts/kubernetes-event-exporter/README.md

-6
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ See [App Configuration](../../README.md) for reference.
3030
3131
## Install Chart
3232
33-
Ensure `monitoring` namespace exists
34-
35-
```shell
36-
kubectl create ns monitoring
37-
```
38-
3933
Install chart
4034
4135
```bash

charts/kubernetes-event-exporter/templates/configmap.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ kind: ConfigMap
33
metadata:
44
name: {{ include "kubernetes-event-exporter.fullname" . }}-cfg
55
namespace: {{ template "kubernetes-event-exporter.namespace" . }}
6+
labels:
7+
{{- include "kubernetes-event-exporter.labels" . | nindent 4 }}
68
data:
79
config.yaml: |
810
{{ .Values.config | indent 4 }}

charts/kubernetes-event-exporter/templates/deployment.yaml

+23-3
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,33 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4+
{{- with .Values.deploymentAnnotations }}
5+
annotations:
6+
{{- toYaml . | nindent 4 }}
7+
{{- end }}
48
name: {{ include "kubernetes-event-exporter.fullname" . }}
59
namespace: {{ include "kubernetes-event-exporter.namespace" . }}
10+
labels:
11+
{{- include "kubernetes-event-exporter.labels" . | nindent 4 }}
12+
{{- with .Values.deploymentLabels }}
13+
{{- toYaml . | nindent 4 }}
14+
{{- end }}
615
spec:
716
replicas: {{ .Values.replicaCount }}
817
selector:
918
matchLabels:
1019
{{- include "kubernetes-event-exporter.selectorLabels" . | nindent 6 }}
1120
template:
1221
metadata:
13-
{{- with .Values.podAnnotations }}
1422
annotations:
23+
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
24+
{{- with .Values.podAnnotations }}
1525
{{- toYaml . | nindent 8 }}
1626
{{- end }}
1727
labels:
1828
{{- include "kubernetes-event-exporter.selectorLabels" . | nindent 8 }}
1929
spec:
20-
{{- with .Values.imagePullSecrets }}
30+
{{- with .Values.global.imagePullSecrets }}
2131
imagePullSecrets:
2232
{{- toYaml . | nindent 8 }}
2333
{{- end }}
@@ -28,7 +38,7 @@ spec:
2838
- name: {{ .Chart.Name }}
2939
securityContext:
3040
{{- toYaml .Values.securityContext | nindent 12 }}
31-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
41+
image: "{{ .Values.global.imageRegistry | default .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
3242
imagePullPolicy: {{ .Values.image.pullPolicy }}
3343
ports:
3444
- name: metrics
@@ -47,6 +57,9 @@ spec:
4757
volumeMounts:
4858
- mountPath: /data
4959
name: cfg
60+
{{- with .Values.extraVolumeMounts }}
61+
{{- toYaml . | nindent 12 }}
62+
{{- end }}
5063
resources:
5164
{{- toYaml .Values.resources | nindent 12 }}
5265
{{- with .Values.nodeSelector }}
@@ -61,7 +74,14 @@ spec:
6174
tolerations:
6275
{{- toYaml . | nindent 8 }}
6376
{{- end }}
77+
{{- with .Values.topologySpreadConstraints }}
78+
topologySpreadConstraints:
79+
{{- toYaml . | nindent 8 }}
80+
{{- end }}
6481
volumes:
6582
- name: cfg
6683
configMap:
6784
name: {{ include "kubernetes-event-exporter.fullname" . }}-cfg
85+
{{- with .Values.extraVolumes }}
86+
{{- toYaml . | nindent 8 }}
87+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{{- if .Values.rbac.create }}
22
---
33
apiVersion: rbac.authorization.k8s.io/v1
4-
kind: ClusterRole
4+
kind: {{ .Values.rbac.namespaced | ternary "Role" "ClusterRole" }}
55
metadata:
66
name: {{ include "kubernetes-event-exporter.fullname" . }}
7+
labels:
8+
{{- include "kubernetes-event-exporter.labels" . | nindent 4 }}
79
rules:
8-
- apiGroups: ["*"]
9-
resources: ["*"]
10-
verbs: ["get", "watch", "list"]
10+
{{ toYaml .Values.rbac.rules }}
1111
{{- end -}}

charts/kubernetes-event-exporter/templates/rolebinding.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{{- if .Values.rbac.create }}
22
---
33
apiVersion: rbac.authorization.k8s.io/v1
4-
kind: ClusterRoleBinding
4+
kind: {{ .Values.rbac.namespaced | ternary "RoleBinding" "ClusterRoleBinding" }}
55
metadata:
6-
name: {{ include "kubernetes-event-exporter.fullname" . }}
6+
name: {{ include "kubernetes-event-exporter.fullname" . }}
7+
labels:
8+
{{- include "kubernetes-event-exporter.labels" . | nindent 4 }}
79
roleRef:
810
apiGroup: rbac.authorization.k8s.io
911
kind: ClusterRole

charts/kubernetes-event-exporter/templates/serviceaccount.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ kind: ServiceAccount
44
metadata:
55
name: {{ include "kubernetes-event-exporter.serviceAccountName" . }}
66
namespace: {{ include "kubernetes-event-exporter.namespace" . }}
7+
labels:
8+
{{- include "kubernetes-event-exporter.labels" . | nindent 4 }}
79
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{{- if .Values.serviceMonitor.enabled }}
2+
apiVersion: monitoring.coreos.com/v1
3+
kind: ServiceMonitor
4+
metadata:
5+
name: {{ template "kubernetes-event-exporter.fullname" . }}
6+
{{- if .Values.serviceMonitor.namespace }}
7+
namespace: {{ . }}
8+
{{- else }}
9+
namespace: {{ include "kubernetes-event-exporter.namespace" . }}
10+
{{- end }}
11+
labels:
12+
{{- include "kubernetes-event-exporter.labels" . | nindent 4 }}
13+
spec:
14+
endpoints:
15+
- port: metrics
16+
{{- if .Values.serviceMonitor.interval }}
17+
interval: {{ .Values.serviceMonitor.interval }}
18+
{{- end }}
19+
{{- if .Values.serviceMonitor.scheme }}
20+
scheme: {{ .Values.serviceMonitor.scheme }}
21+
{{- end }}
22+
{{- if .Values.serviceMonitor.bearerTokenFile }}
23+
bearerTokenFile: {{ .Values.serviceMonitor.bearerTokenFile }}
24+
{{- end }}
25+
{{- if .Values.serviceMonitor.tlsConfig }}
26+
tlsConfig: {{ toYaml .Values.serviceMonitor.tlsConfig | nindent 6 }}
27+
{{- end }}
28+
{{- if .Values.serviceMonitor.scrapeTimeout }}
29+
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
30+
{{- end }}
31+
path: /metrics
32+
honorLabels: {{ .Values.serviceMonitor.honorLabels }}
33+
{{- if .Values.serviceMonitor.metricRelabelings }}
34+
metricRelabelings:
35+
{{- tpl (toYaml .Values.serviceMonitor.metricRelabelings | nindent 4) . }}
36+
{{- end }}
37+
{{- if .Values.serviceMonitor.relabelings }}
38+
relabelings:
39+
{{ toYaml .Values.serviceMonitor.relabelings | nindent 4 }}
40+
{{- end }}
41+
namespaceSelector:
42+
matchNames:
43+
- {{ template "kubernetes-event-exporter.namespace" . }}
44+
selector:
45+
matchLabels:
46+
{{- include "kubernetes-event-exporter.selectorLabels" . | nindent 6 }}
47+
{{- end -}}

0 commit comments

Comments
 (0)