Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[helm] add the possibility to overwrite Pod and Container SecurityContext #1148

Merged
merged 5 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions helm/robusta/templates/forwarder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ spec:
imagePullSecrets:
{{- toYaml .Values.kubewatch.imagePullSecrets | nindent 6 }}
{{- end }}
{{- if .Values.kubewatch.securityContext.pod }}
securityContext:
{{- toYaml .Values.kubewatch.securityContext.pod | nindent 6 }}
{{- end }}
containers:
- name: kubewatch
# this is a custom version of kubewatch built from https://github.com/aantn/kubewatch
Expand All @@ -51,12 +55,17 @@ spec:
{{- with .Values.kubewatch.extraVolumeMounts }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- if .Values.kubewatch.securityContext.container }}
securityContext:
{{- toYaml .Values.kubewatch.securityContext.container | nindent 10 }}
{{ else }}
securityContext:
allowPrivilegeEscalation: false
capabilities: {}
privileged: false
readOnlyRootFilesystem: false
runAsUser: 1000
{{- end }}
resources:
requests:
cpu: {{ .Values.kubewatch.resources.requests.cpu }}
Expand Down
9 changes: 9 additions & 0 deletions helm/robusta/templates/runner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ spec:
imagePullSecrets:
{{- toYaml .Values.runner.imagePullSecrets | nindent 6 }}
{{- end }}
{{- if .Values.runner.securityContext.pod }}
securityContext:
{{- toYaml .Values.runner.securityContext.pod | nindent 6 }}
{{- end }}
containers:
- name: runner
{{- if .Values.runner.image }}
Expand All @@ -40,11 +44,16 @@ spec:
image: {{ .Values.image.registry }}/{{ .Values.runner.imageName }}
{{- end }}
imagePullPolicy: {{ .Values.runner.imagePullPolicy }}
{{- if .Values.runner.securityContext.container }}
securityContext:
{{- toYaml .Values.runner.securityContext.container | nindent 10 }}
{{ else }}
securityContext:
allowPrivilegeEscalation: false
capabilities: {}
privileged: false
readOnlyRootFilesystem: false
{{- end }}
env:
- name: PLAYBOOKS_CONFIG_FILE_PATH
value: /etc/robusta/config/active_playbooks.yaml
Expand Down
6 changes: 6 additions & 0 deletions helm/robusta/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,9 @@ kubewatch:
event: true # updated on kubewatch 2.5
coreevent: false # added on kubewatch 2.5
ingress: true # full support on kubewatch 2.4 (earlier versions have ingress bugs)
securityContext:
pod: ~
container: ~

# parameters for the renderer service used in robusta runner to render grafana graphs
grafanaRenderer:
Expand Down Expand Up @@ -522,6 +525,9 @@ runner:
imagePullSecrets: []
extraVolumes: []
extraVolumeMounts: []
securityContext:
pod: ~
container: ~
serviceMonitor:
path: /metrics

Expand Down
Loading