From 8388d4459ab9e5877b71dc77108d1143807a86d4 Mon Sep 17 00:00:00 2001 From: Anna Kapuscinska Date: Tue, 5 Dec 2023 15:05:22 +0000 Subject: [PATCH] helm: Add extensions templates The goal is to make it easy to build custom distributions of Tetragon Helm chart. Signed-off-by: Anna Kapuscinska --- .../kubernetes/tetragon/templates/_container_tetragon.tpl | 1 + install/kubernetes/tetragon/templates/_extensions.tpl | 7 +++++++ install/kubernetes/tetragon/templates/daemonset.yaml | 3 +++ .../kubernetes/tetragon/templates/tetragon_configmap.yaml | 1 + 4 files changed, 12 insertions(+) create mode 100644 install/kubernetes/tetragon/templates/_extensions.tpl diff --git a/install/kubernetes/tetragon/templates/_container_tetragon.tpl b/install/kubernetes/tetragon/templates/_container_tetragon.tpl index a11690e9dc4..03617f510be 100644 --- a/install/kubernetes/tetragon/templates/_container_tetragon.tpl +++ b/install/kubernetes/tetragon/templates/_container_tetragon.tpl @@ -51,6 +51,7 @@ mountPath: {{ .mountPath }} readOnly: {{ .readOnly }} {{- end }} + {{- include "tetragon.volumemounts.extra" . | nindent 4 }} env: - name: NODE_NAME valueFrom: diff --git a/install/kubernetes/tetragon/templates/_extensions.tpl b/install/kubernetes/tetragon/templates/_extensions.tpl new file mode 100644 index 00000000000..8e160597aa3 --- /dev/null +++ b/install/kubernetes/tetragon/templates/_extensions.tpl @@ -0,0 +1,7 @@ +{{- define "configmap.extra" -}}{{- end }} + +{{- define "volumes.extra" -}}{{- end }} + +{{- define "tetragon.volumemounts.extra" -}}{{- end }} + +{{- define "initcontainers.extra" -}}{{- end }} diff --git a/install/kubernetes/tetragon/templates/daemonset.yaml b/install/kubernetes/tetragon/templates/daemonset.yaml index 28e474b4173..f612f3c5376 100644 --- a/install/kubernetes/tetragon/templates/daemonset.yaml +++ b/install/kubernetes/tetragon/templates/daemonset.yaml @@ -50,6 +50,8 @@ spec: securityContext: {{- toYaml . | nindent 8 }} {{- end }} + initContainers: + {{- include "initcontainers.extra" . | nindent 6 }} containers: {{- if eq .Values.export.mode "stdout" }} {{- include "container.export.stdout" . | nindent 6 -}} @@ -102,6 +104,7 @@ spec: hostPath: path: {{ .mountPath }} {{- end }} + {{- include "volumes.extra" . | nindent 6 }} {{- with .Values.updateStrategy }} updateStrategy: {{- toYaml . | nindent 4 }} diff --git a/install/kubernetes/tetragon/templates/tetragon_configmap.yaml b/install/kubernetes/tetragon/templates/tetragon_configmap.yaml index a0988139cd1..46f6354eb46 100644 --- a/install/kubernetes/tetragon/templates/tetragon_configmap.yaml +++ b/install/kubernetes/tetragon/templates/tetragon_configmap.yaml @@ -56,3 +56,4 @@ data: enable-msg-handling-latency: "true" {{- end }} enable-pod-info: {{ .Values.tetragonOperator.podInfo.enabled | quote }} + {{- include "configmap.extra" . | nindent 2 }}