Skip to content
Open
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
8 changes: 7 additions & 1 deletion helm/kagent-tools/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ spec:
volumeMounts:
- name: tmp
mountPath: /tmp
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: tmp
emptyDir: {}
emptyDir: {}
{{- with .Values.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
39 changes: 39 additions & 0 deletions helm/kagent-tools/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,42 @@ tests:
value:
app.kubernetes.io/name: RELEASE-NAME
app.kubernetes.io/instance: RELEASE-NAME

- it: should only mount the tmp volume by default
asserts:
- lengthEqual:
path: spec.template.spec.volumes
count: 1
- lengthEqual:
path: spec.template.spec.containers[0].volumeMounts
count: 1

- it: should append extraVolumes and extraVolumeMounts after tmp
set:
extraVolumes:
- name: kubeconfig
configMap:
name: tools-kubeconfig
extraVolumeMounts:
- name: kubeconfig
mountPath: /etc/kubeconfig
readOnly: true
asserts:
- equal:
path: spec.template.spec.volumes[0].name
value: tmp
- equal:
path: spec.template.spec.volumes[1]
value:
name: kubeconfig
configMap:
name: tools-kubeconfig
- equal:
path: spec.template.spec.containers[0].volumeMounts[0].name
value: tmp
- equal:
path: spec.template.spec.containers[0].volumeMounts[1]
value:
name: kubeconfig
mountPath: /etc/kubeconfig
readOnly: true
12 changes: 12 additions & 0 deletions helm/kagent-tools/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,15 @@ otel:
endpoint: http://host.docker.internal:4317
timeout: 15
insecure: true

# Additional volumes and volumeMounts on the tools container. Useful for mounting a
# kubeconfig (e.g. to point kubectl at an authenticating proxy for per-user RBAC),
# extra CAs, etc. Standard Kubernetes volume / volumeMount objects.
extraVolumes: []
# - name: my-kubeconfig
# configMap:
# name: my-kubeconfig
extraVolumeMounts: []
# - name: my-kubeconfig
# mountPath: /etc/kubeconfig
# readOnly: true
Loading