Skip to content

Commit 91e9eae

Browse files
committed
feat: add custom spec and env for agent
1 parent b4e3ab7 commit 91e9eae

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

charts/kubernetes-agent/templates/tentacle-deployment.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ spec:
2222
{{- toYaml . | nindent 8 }}
2323
{{- end }}
2424
spec:
25+
{{- with .Values.agent.spec }}
26+
{{- toYaml . | nindent 6 }}
27+
{{- end }}
2528
{{- with .Values.imagePullSecrets }}
2629
imagePullSecrets:
2730
{{- toYaml . | nindent 8 }}
@@ -33,6 +36,9 @@ spec:
3336
{{- end }}
3437
containers:
3538
- name: {{printf "%s-tentacle" (include "kubernetes-agent.name" .) }}
39+
{{- with .Values.agent.containers.tentacle.spec }}
40+
{{- toYaml . | nindent 10 }}
41+
{{- end }}
3642
image: {{ include "kubernetes-agent.fullImage" . | quote }}
3743
imagePullPolicy: {{ .Values.agent.image.pullPolicy }}
3844
startupProbe:
@@ -199,6 +205,9 @@ spec:
199205
key: polling-proxy-password
200206
{{- end }}
201207
{{- end }}
208+
{{- with .Values.agent.containers.tentacle.env }}
209+
{{- toYaml . | nindent 12 }}
210+
{{- end }}
202211
{{- with .Values.agent.resources }}
203212
resources:
204213
{{- toYaml . | nindent 12 }}
@@ -230,6 +239,9 @@ spec:
230239
{{- end }}
231240
{{- if and .Values.persistence.nfs.watchdog.enabled (not (include "kubernetes-agent.useCustomPvc" .)) }}
232241
- name: nfs-watchdog
242+
{{- with .Values.agent.containers.watchdog.spec }}
243+
{{- toYaml . | nindent 10 }}
244+
{{- end }}
233245
image: "{{ .Values.persistence.nfs.watchdog.image.repository }}:{{ .Values.persistence.nfs.watchdog.image.tag }}"
234246
imagePullPolicy: {{ .Values.persistence.nfs.watchdog.image.pullPolicy }}
235247
env:
@@ -247,6 +259,9 @@ spec:
247259
- name: "watchdog_timeout_seconds"
248260
value: "{{ .Values.persistence.nfs.watchdog.timeout_seconds }}"
249261
{{ end }}
262+
{{- with .Values.agent.containers.tentacle.env }}
263+
{{- toYaml . | nindent 12 }}
264+
{{- end }}
250265
volumeMounts:
251266
- mountPath: /octopus
252267
name: tentacle-home

charts/kubernetes-agent/tests/tentacle-deployment_test.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,3 +296,13 @@ tests:
296296
- equal:
297297
path: spec.template.spec.containers[0].image
298298
value: "octopusdeploy/kubernetes-agent-tentacle:8.3.3359-bullseye-slim"
299+
300+
- it: "sets custom spec properly"
301+
set:
302+
agent:
303+
spec:
304+
priorityClassName: "custom-priority-class"
305+
asserts:
306+
- equal:
307+
path: spec.template.spec.priorityClassName
308+
value: "custom-priority-class"

charts/kubernetes-agent/values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,17 @@ agent:
188188
# @section -- Agent values
189189
securityContext: {}
190190

191+
# -- Additional pod spec to apply to the agent pod - does not override any other agent configuration
192+
# @section -- Agent values
193+
spec: {}
194+
containers:
195+
tentacle:
196+
spec: {}
197+
env: {}
198+
watchdog:
199+
spec: {}
200+
env: {}
201+
191202
debug:
192203
# -- Disables automatic pod cleanup
193204
# @section -- Agent values

0 commit comments

Comments
 (0)