Skip to content

Commit 4a05fdd

Browse files
author
Torkel Hoge
committed
fix: remove unnecessary code from charts
1 parent f173297 commit 4a05fdd

9 files changed

Lines changed: 10 additions & 185 deletions

File tree

‎install/helm/Chart.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ dependencies:
7777
tags: [cs-lib]
7878

7979
annotations:
80-
runtime-monitor.tetragon: quay.io/cilium/tetragon:v1.5.0
80+
runtime-monitor.tetragon: quay.io/cilium/tetragon:v1.7.0
8181
postgresql: postgres:17.5
8282
postgresql.metrics: quay.io/prometheuscommunity/postgres-exporter:v0.17.1
8383
redis: redis:8.0.2

‎runtime-monitor/.helm/templates/_container_tetragon.tpl‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{- define "container.tetragon" -}}
22
- name: {{ include "container.tetragon.name" . }}
33
securityContext:
4-
{{- toYaml .Values.tetragon.containerSecurityContext | nindent 4 }}
4+
{{- toYaml .Values.tetragon.securityContext | nindent 4 }}
55
image: {{ include "common.cs.image" (dict "context" . "image" .Values.tetragon.image) }}
66
imagePullPolicy: {{ .Values.image.pullPolicy }}
77
terminationMessagePolicy: FallbackToLogsOnError
@@ -34,8 +34,6 @@
3434
name: bpf-maps
3535
- mountPath: "/var/run/cilium"
3636
name: cilium-run
37-
- mountPath: "/var/run/tetragon"
38-
name: tetragon-run
3937
- mountPath: {{ .Values.exportDirectory }}
4038
name: export-logs
4139
- mountPath: "/procRoot"
@@ -60,7 +58,6 @@
6058
mountPath: {{ .mountPath }}
6159
readOnly: {{ .readOnly }}
6260
{{- end }}
63-
{{- include "tetragon.volumemounts.extra" . | nindent 4 }}
6461
env:
6562
- name: NODE_NAME
6663
valueFrom:

‎runtime-monitor/.helm/templates/_extensions.tpl‎

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 5 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,17 @@
11
{{/*
2-
Resources names
2+
Create chart name and version as used by the chart label.
33
*/}}
4-
{{- define "tetragon.name" -}}
5-
{{- default .Release.Name .Values.tetragon.nameOverride | trunc 63 | trimSuffix "-" }}
4+
{{- define "tetragon.chart" -}}
5+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
66
{{- end }}
77

8-
{{- define "tetragon.configMapName" -}}
9-
{{- printf "%s-config" (include "tetragon.name" .) | trunc 63 | trimSuffix "-" }}
10-
{{- end }}
11-
12-
{{- define "tetragon.clusterRole" -}}
13-
{{- include "tetragon.name" . }}
14-
{{- end }}
15-
16-
{{- define "tetragon.role" -}}
17-
{{- include "tetragon.name" . }}
18-
{{- end }}
19-
20-
{{- define "tetragon-operator.name" -}}
21-
{{- default (printf "%s-operator" .Release.Name) .Values.tetragonOperator.nameOverride | trunc 63 | trimSuffix "-" }}
22-
{{- end }}
23-
24-
{{- define "tetragon-operator.clusterRole" -}}
25-
{{- include "tetragon-operator.name" . }}
26-
{{- end }}
27-
28-
{{- define "tetragon-operator.roleBindingName" -}}
29-
{{- printf "%s-rolebinding" (include "tetragon-operator.name" .) | trunc 63 | trimSuffix "-" }}
30-
{{- end }}
31-
32-
{{- define "tetragon-operator.configMapName" -}}
33-
{{- printf "%s-config" (include "tetragon-operator.name" .) | trunc 63 | trimSuffix "-" }}
34-
{{- end }}
35-
36-
{{- define "tetragon-rthooks.name" -}}
37-
{{- default (printf "%s-rthooks" .Release.Name) .Values.rthooks.nameOverride | trunc 63 | trimSuffix "-" }}
38-
{{- end }}
39-
40-
418
{{/*
429
Common labels
4310
*/}}
44-
{{- define "commonLabels" -}}
45-
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
46-
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
47-
app.kubernetes.io/managed-by: {{ .Release.Service }}
48-
app.kubernetes.io/part-of: {{ .Chart.Name }}
49-
{{- end }}
50-
5111
{{- define "tetragon.labels" -}}
12+
helm.sh/chart: {{ include "tetragon.chart" . }}
5213
{{ include "tetragon.selectorLabels" . }}
53-
{{ include "commonLabels" . }}
54-
app.kubernetes.io/component: agent
55-
{{- end }}
56-
{{- define "tetragon-operator.labels" -}}
57-
{{ include "tetragon-operator.selectorLabels" . }}
58-
{{ include "commonLabels" . }}
59-
app.kubernetes.io/component: operator
60-
{{- end }}
61-
{{- define "tetragon-rthooks.labels" -}}
62-
{{ include "tetragon-rthooks.selectorLabels" . }}
63-
{{ include "commonLabels" . }}
64-
app.kubernetes.io/component: rthooks
14+
app.kubernetes.io/managed-by: {{ .Release.Service }}
6515
{{- end }}
6616

6717
{{/*
@@ -71,72 +21,15 @@ Selector labels
7121
app.kubernetes.io/name: {{ .Chart.Name }}
7222
app.kubernetes.io/instance: {{ .Release.Name }}
7323
{{- end }}
74-
{{- define "tetragon-operator.selectorLabels" -}}
75-
app.kubernetes.io/name: "tetragon-operator"
76-
app.kubernetes.io/instance: {{ .Release.Name }}
77-
{{- end }}
78-
{{- define "tetragon-rthooks.selectorLabels" -}}
79-
app.kubernetes.io/name: "tetragon-rthooks"
80-
app.kubernetes.io/instance: {{ .Release.Name }}
81-
{{- end }}
82-
83-
{{- define "container.export.stdout.name" -}}
84-
{{- print "export-stdout" -}}
85-
{{- end }}
8624

8725
{{- define "container.tetragon.name" -}}
8826
{{- print "tetragon" -}}
8927
{{- end }}
9028

91-
{{/*
92-
ServiceAccounts
93-
*/}}
94-
{{- define "tetragon.serviceAccount" -}}
95-
{{- if .Values.serviceAccount.name -}}
96-
{{- printf "%s" .Values.serviceAccount.name -}}
97-
{{- else -}}
98-
{{- include "tetragon.name" . -}}
99-
{{- end -}}
100-
{{- end }}
101-
102-
{{- define "tetragon-operator.serviceAccount" -}}
103-
{{- if .Values.tetragonOperator.serviceAccount.name -}}
104-
{{- printf "%s" .Values.tetragonOperator.serviceAccount.name -}}
105-
{{- else -}}
106-
{{- printf "%s-service-account" (include "tetragon-operator.name" .) -}}
107-
{{- end -}}
108-
{{- end }}
109-
11029
{{- define "container.tetragonOCIHookSetup.installPath" -}}
11130
{{- print "/hostInstall" -}}
11231
{{- end }}
11332

11433
{{- define "container.tetragonOCIHookSetup.hooksPath" -}}
11534
{{- print "/hostHooks" -}}
11635
{{- end }}
117-
118-
{{/*
119-
Runtime-hooks
120-
*/}}
121-
122-
{{- define "rthooksInterface" -}}
123-
{{ $iface := .Values.rthooks.interface }}
124-
{{- if (eq $iface "oci-hooks") -}}
125-
oci-hooks
126-
{{- else if (eq $iface "nri-hook") -}}
127-
nri-hook
128-
{{- else -}}
129-
{{- end -}}
130-
{{- end }}
131-
132-
{{/*
133-
rthooks affinity: when rthooks.affinity is explicitly set (including {}),
134-
use it as-is. Otherwise fall back to the top-level .Values.affinity.
135-
*/}}
136-
{{- define "tetragon-rthooks.affinity" -}}
137-
{{- if hasKey .Values.rthooks "affinity" -}}
138-
{{- toYaml .Values.rthooks.affinity -}}
139-
{{- else -}}
140-
{{- toYaml .Values.affinity -}}
141-
{{- end -}}
142-
{{- end }}

‎runtime-monitor/.helm/templates/clusterrole.yaml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,4 @@ rules:
3737
- get
3838
- list
3939
- watch
40-
{{- include "clusterrole.extra" . | nindent 2 }}
4140
{{- end }}

‎runtime-monitor/.helm/templates/daemonset.yaml‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,13 @@ spec:
2424
{{- toYaml . | nindent 8 }}
2525
{{- end }}
2626
serviceAccountName: {{ include "common.serviceAccountName" . }}
27-
{{- with .Values.podSecurityContext }}
27+
{{- if (.Values.podSecurityContext).enabled }}
2828
securityContext:
29-
{{- toYaml . | nindent 8 }}
29+
{{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }}
3030
{{- end }}
31-
initContainers:
32-
{{- include "initcontainers.extra" . | nindent 6 }}
3331
containers:
3432
{{- include "common.cs.container.app" . | nindent 8 -}}
3533
{{- include "container.tetragon" . | nindent 8 -}}
36-
{{- if eq (include "common.cs.logger.enabled" .) "true" -}}
37-
{{- include "common.cs.container.logger" . | nindent 8 -}}
38-
{{- end -}}
3934
{{- with .Values.nodeSelector }}
4035
nodeSelector:
4136
{{- toYaml . | nindent 8 }}
@@ -56,10 +51,6 @@ spec:
5651
hostPath:
5752
path: /var/run/cilium
5853
type: DirectoryOrCreate
59-
- name: tetragon-run
60-
hostPath:
61-
path: /var/run/tetragon
62-
type: DirectoryOrCreate
6354
- name: export-logs
6455
hostPath:
6556
path: {{ .Values.exportDirectory }}

‎runtime-monitor/.helm/templates/role.yaml‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎runtime-monitor/.helm/templates/rolebinding.yaml‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎runtime-monitor/.helm/templates/tetragon_configmap.yaml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ data:
1717
debug: {{ .Values.tetragon.debug | quote }}
1818
enable-process-cred: {{ .Values.tetragon.enableProcessCred | quote }}
1919
enable-process-ns: {{ .Values.tetragon.enableProcessNs | quote }}
20-
enable-ancestors: {{ .Values.tetragon.processAncestors.enabled | quote }}
20+
enable-ancestors: {{ .Values.tetragon.processAncestors.enabled }}
2121
process-cache-size: {{ .Values.tetragon.processCacheSize | quote }}
2222
{{- if .Values.tetragon.exportFilename }}
2323
export-filename: {{ .Values.exportDirectory}}/{{ .Values.tetragon.exportFilename }}
@@ -79,7 +79,6 @@ data:
7979
{{- end }}
8080
event-cache-retries: {{ .Values.tetragon.eventCacheRetries | quote }}
8181
event-cache-retry-delay: {{ .Values.tetragon.eventCacheRetryDelay | quote }}
82-
{{- include "configmap.extra" . | nindent 2 }}
8382
{{- if .Values.tetragon.enableKeepSensorsOnExit }}
8483
keep-sensors-on-exit: "true"
8584
release-pinned-bpf: "false"
@@ -91,4 +90,3 @@ data:
9190
{{- end }}
9291
enable-cgidmap: {{ .Values.tetragon.cgidmap.enabled | quote }}
9392
enable-pod-annotations: {{ .Values.tetragon.podAnnotations.enabled | default "false" | quote }}
94-
use-perf-ring-buffer: {{ .Values.tetragon.usePerfRingBuffer | default "false" | quote }}

0 commit comments

Comments
 (0)