Skip to content
This repository was archived by the owner on May 16, 2023. It is now read-only.
Closed
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 metricbeat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ helm install --name metricbeat elastic/metricbeat --set imageTag=7.5.1
| `imageTag` | The Metricbeat docker image tag | `7.5.1` |
| `imagePullPolicy` | The Kubernetes [imagePullPolicy](https://kubernetes.io/docs/concepts/containers/images/#updating-images) value | `IfNotPresent` |
| `imagePullSecrets` | Configuration for [imagePullSecrets](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#create-a-pod-that-uses-your-secret) so that you can use a private registry for your image | `[]` |
| `daemonsetHostNetworking` | Parameter to enable hostNetwork on the daemonset pods. | `false` |
| `labels` | Configurable [label](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) applied to all Metricbeat pods | `{}` |
| `managedServiceAccount` | Whether the `serviceAccount` should be managed by this helm chart. Set this to `false` in order to manage your own service account and related roles. | `true` |
| `clusterRoleRules` | Configurable [cluster role rules](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#role-and-clusterrole) that Metricbeat uses to access Kubernetes resources. | see [values.yaml](./values.yaml) |
Expand Down
4 changes: 4 additions & 0 deletions metricbeat/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ spec:
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- if .Values.daemonsetHostNetworking }}
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
{{- end }}
{{- with .Values.tolerations }}
tolerations: {{ toYaml . | nindent 6 }}
{{- end }}
Expand Down
8 changes: 8 additions & 0 deletions metricbeat/tests/metricbeat_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ def test_adding_an_affinity_rule():
assert r['daemonset'][name]['spec']['template']['spec']['affinity']['podAntiAffinity'][
'requiredDuringSchedulingIgnoredDuringExecution'][0]['topologyKey'] == 'kubernetes.io/hostname'

def test_daemonset_host_networking():
config = '''
daemonsetHostNetworking: true
'''
r = helm_template(config)
assert r['daemonset'][name]['spec']['template']['spec']['hostNetwork'] is True
assert r['daemonset'][name]['spec']['template']['spec']['dnsPolicy'] == "ClusterFirstWithHostNet"

def test_cluster_role_rules():
config = ''
r = helm_template(config)
Expand Down
3 changes: 3 additions & 0 deletions metricbeat/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ imageTag: "7.5.1"
imagePullPolicy: "IfNotPresent"
imagePullSecrets: []

# Setting this to true allow kibana's Infrastructure panel to have the node's name instead of the pod's name
daemonsetHostNetworking: false

livenessProbe:
exec:
command:
Expand Down