From 221bdad1bbfed0c062d7445d9c20874d752b8b22 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 | 2 ++ .../kubernetes/tetragon/templates/tetragon_configmap.yaml | 1 + 4 files changed, 11 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 fd97a9265fd..2cbaba98e99 100644 --- a/install/kubernetes/tetragon/templates/daemonset.yaml +++ b/install/kubernetes/tetragon/templates/daemonset.yaml @@ -54,6 +54,7 @@ spec: {{- if .Values.tetragon.ociHookSetup.enabled }} {{- include "container.tetragon-oci-hook-setup" . | nindent 6 -}} {{- end }} + {{- include "initcontainers.extra" . | nindent 6 }} containers: {{- if eq .Values.export.mode "stdout" }} {{- include "container.export.stdout" . | nindent 6 -}} @@ -116,6 +117,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 }}