Skip to content

Commit fbc804d

Browse files
committed
Add configuration to disable service token automount
Signed-off-by: Jeremy Alvis <jeremy.alvis@solo.io>
1 parent 1e58fe4 commit fbc804d

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

helm/kagent-tools/templates/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ spec:
5252
securityContext:
5353
{{- toYaml .Values.podSecurityContext | nindent 8 }}
5454
serviceAccountName: {{ include "kagent.fullname" . }}
55+
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
5556
containers:
5657
- name: tools
5758
command:

helm/kagent-tools/tests/deployment_test.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,19 @@ tests:
140140
value:
141141
app.kubernetes.io/name: kagent-tools
142142
app.kubernetes.io/instance: RELEASE-NAME
143+
144+
- it: should enable automountServiceAccountToken by default
145+
template: deployment.yaml
146+
asserts:
147+
- equal:
148+
path: spec.template.spec.automountServiceAccountToken
149+
value: true
150+
151+
- it: should disable automountServiceAccountToken when configured
152+
template: deployment.yaml
153+
set:
154+
automountServiceAccountToken: false
155+
asserts:
156+
- equal:
157+
path: spec.template.spec.automountServiceAccountToken
158+
value: false

helm/kagent-tools/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ podSecurityContext: {}
4444
# fsGroup: 2000
4545

4646
securityContext: {}
47+
48+
# Disable service account token mounting to force usage of Authorization header
49+
automountServiceAccountToken: true
4750
# capabilities:
4851
# drop:
4952
# - ALL

0 commit comments

Comments
 (0)