Skip to content

Commit

Permalink
helm: add an rthooks serviceAccount section
Browse files Browse the repository at this point in the history
Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
  • Loading branch information
kkourt committed Sep 2, 2024
1 parent ed28783 commit 6b004e7
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/content/en/docs/reference/helm-chart.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion install/kubernetes/tetragon/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions install/kubernetes/tetragon/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ ServiceAccounts
{{- end -}}
{{- end }}

{{- define "rthooks.serviceAccount" -}}
{{- if .Values.rthooks.serviceAccount.name -}}
{{- printf "%s" .Values.rthooks.serviceAccount.name -}}
{{- else -}}
{{- printf "%s-rthooks-service-account" .Release.Name -}}
{{- end -}}
{{- end }}

{{- define "container.tetragonOCIHookSetup.installPath" -}}
{{- print "/hostInstall" -}}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "rthooks.serviceAccount" . }}
{{- with .Values.rthooks.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
Expand Down
14 changes: 14 additions & 0 deletions install/kubernetes/tetragon/templates/rthooks_serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if and .Values.rthooks.enabled .Values.rthooks.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "rthooks.serviceAccount" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tetragon-rthooks.labels" . | nindent 4 }}
{{- with .Values.rthooks.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

5 changes: 5 additions & 0 deletions install/kubernetes/tetragon/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -392,3 +392,8 @@ rthooks:
override: ~
repository: quay.io/cilium/tetragon-rthooks
tag: v0.2
# -- rthooks service account.
serviceAccount:
create: true
annotations: {}
name: ""

0 comments on commit 6b004e7

Please sign in to comment.