Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

[filebeat] Add flag to optionally mount the Docker socket #1671

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
1 change: 1 addition & 0 deletions filebeat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ as a reference. They are also used in the automated testing of this chart.
| `daemonset.podSecurityContext` | Configurable [podSecurityContext][] for filebeat DaemonSet pod execution environment | see [values.yaml][] |
| `daemonset.resources` | Allows you to set the [resources][] for filebeat DaemonSet | see [values.yaml][] |
| `daemonset.tolerations` | Configurable [tolerations][] for filebeat DaemonSet | `[]` |
| `daemonset.dockerSockMount` | If true, mounts the docker socket from `/var/run/docker.sock` | `true` |
| `deployment.annotations` | Configurable [annotations][] for filebeat Deployment | `{}` |
| `deployment.labels` | Configurable [labels][] applied to all filebeat Deployment pods | `{}` |
| `deployment.affinity` | Configurable [affinity][] for filebeat Deployment | `{}` |
Expand Down
4 changes: 4 additions & 0 deletions filebeat/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ spec:
- name: varlog
hostPath:
path: /var/log
{{- if .Values.daemonset.dockerSockMount }}
- name: varrundockersock
hostPath:
path: /var/run/docker.sock
{{- end }}
{{- if .Values.extraVolumes | default .Values.daemonset.extraVolumes }}
{{ toYaml ( .Values.extraVolumes | default .Values.daemonset.extraVolumes ) | indent 6 }}
{{- end }}
Expand Down Expand Up @@ -189,9 +191,11 @@ spec:
readOnly: true
# Necessary when using autodiscovery; avoid mounting it otherwise
# See: https://www.elastic.co/guide/en/beats/filebeat/master/configuration-autodiscover.html
{{- if .Values.daemonset.dockerSockMount }}
- name: varrundockersock
mountPath: /var/run/docker.sock
readOnly: true
{{- end }}
{{- if .Values.extraVolumeMounts | default .Values.daemonset.extraVolumeMounts }}
{{ toYaml (.Values.extraVolumeMounts | default .Values.daemonset.extraVolumeMounts ) | indent 8 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions filebeat/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ daemonset:
password: '${ELASTICSEARCH_PASSWORD}'
protocol: https
ssl.certificate_authorities: ["/usr/share/filebeat/certs/ca.crt"]
# Mount Docker socket /var/run/docker.sock
dockerSockMount: true
# Only used when updateStrategy is set to "RollingUpdate"
maxUnavailable: 1
nodeSelector: {}
Expand Down