Skip to content

Commit ecc2d65

Browse files
authored
Sonnet: Allow adjusting host mounts via chart values (#14)
1 parent a1052c5 commit ecc2d65

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

templates/daemonset.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,17 @@ spec:
9090
- name: docker-containers
9191
mountPath: /var/lib/docker/containers
9292
readOnly: true
93+
{{- if .Values.collector.hostMounts.paths }}
94+
{{- range $index, $path := .Values.collector.hostMounts.paths }}
95+
- name: hostfs-{{ $index }}
96+
mountPath: /host{{ $path }}
97+
readOnly: true
98+
{{- end }}
99+
{{- else }}
93100
- name: hostfs
94101
mountPath: /host
95102
readOnly: true
103+
{{- end }}
96104
resources:
97105
{{- toYaml .Values.collector.resources | nindent 10 }}
98106
{{- if .Values.beyla.enabled }}
@@ -198,10 +206,19 @@ spec:
198206
- name: docker-containers
199207
hostPath:
200208
path: /var/lib/docker/containers
209+
{{- if .Values.collector.hostMounts.paths }}
210+
{{- range $index, $path := .Values.collector.hostMounts.paths }}
211+
- name: hostfs-{{ $index }}
212+
hostPath:
213+
path: {{ $path }}
214+
type: ""
215+
{{- end }}
216+
{{- else }}
201217
- name: hostfs
202218
hostPath:
203219
path: /
204220
type: ""
221+
{{- end }}
205222
{{- if .Values.beyla.enabled }}
206223
# Beyla volumes
207224
- name: sys-kernel-tracing

values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ collector:
4242
# Port for internal OTLP communication
4343
otlpPort: 34320
4444

45+
# Host filesystem mount configuration
46+
# By default, mounts the entire host root filesystem at /host (read-only)
47+
# You can specify specific paths to mount instead. Each path will be mounted
48+
# under /host with the same path structure (e.g., /var/www -> /host/var/www)
49+
hostMounts:
50+
# Array of host paths to mount. If empty, mounts root filesystem
51+
# Example: ["/var/www/custom", "/var/lib/something"]
52+
paths: []
53+
4554
# Beyla configuration for eBPF tracing
4655
beyla:
4756
enabled: true

0 commit comments

Comments
 (0)