feat: add spec.template.spec.securityContext (#1109)

* feat: add spec.template.spec.securityContext 

Signed-off-by: ChristianBieri1995 <122007149+ChristianBieri1995@users.noreply.github.com>

* make securityContext adjustable

Signed-off-by: ChristianBieri1995 <122007149+ChristianBieri1995@users.noreply.github.com>

* adjust values.yaml accordingly to enable adjustable securityContext

Signed-off-by: ChristianBieri1995 <122007149+ChristianBieri1995@users.noreply.github.com>

* Remove default values from securityContext

Signed-off-by: ChristianBieri1995 <122007149+ChristianBieri1995@users.noreply.github.com>

---------

Signed-off-by: ChristianBieri1995 <122007149+ChristianBieri1995@users.noreply.github.com>
Co-authored-by: Aris Boutselis <arisboutselis08@gmail.com>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
This commit is contained in:
ChristianBieri1995 2024-06-14 10:05:24 +02:00 committed by GitHub
parent 4867d39c66
commit 92dd1bd8b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -21,6 +21,10 @@ spec:
app.kubernetes.io/name: {{ include "k8sgpt.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- if .Values.deployment.securityContext }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 8 }}
{{ end -}}
serviceAccountName: {{ template "k8sgpt.fullname" . }}
containers:
- name: k8sgpt-container

View File

@ -14,7 +14,10 @@ deployment:
requests:
cpu: "0.2"
memory: "156Mi"
securityContext: {}
# Set securityContext.runAsUser/runAsGroup if necessary. Values below were taken from https://github.com/k8sgpt-ai/k8sgpt/blob/main/container/Dockerfile
# runAsUser: 65532
# runAsGroup: 65532
secret:
secretKey: "" # base64 encoded OpenAI token