From 84cc72f0a61063a62805e229210c42c55b2be646 Mon Sep 17 00:00:00 2001 From: Julien Mailleret Date: Wed, 18 Dec 2019 15:30:30 +0100 Subject: [PATCH] [metricbeat] apply labels to all pods --- metricbeat/templates/daemonset.yaml | 3 +++ metricbeat/tests/metricbeat_test.py | 1 + 2 files changed, 4 insertions(+) diff --git a/metricbeat/templates/daemonset.yaml b/metricbeat/templates/daemonset.yaml index 090af1355..6bc6441e3 100644 --- a/metricbeat/templates/daemonset.yaml +++ b/metricbeat/templates/daemonset.yaml @@ -34,6 +34,9 @@ spec: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" heritage: {{ .Release.Service | quote }} release: {{ .Release.Name | quote }} + {{- range $key, $value := .Values.labels }} + {{ $key }}: {{ $value | quote }} + {{- end }} spec: {{- with .Values.tolerations }} tolerations: {{ toYaml . | nindent 6 }} diff --git a/metricbeat/tests/metricbeat_test.py b/metricbeat/tests/metricbeat_test.py index f5fd7443e..cb7a192e9 100644 --- a/metricbeat/tests/metricbeat_test.py +++ b/metricbeat/tests/metricbeat_test.py @@ -238,6 +238,7 @@ def test_adding_pod_labels(): ''' r = helm_template(config) assert r['daemonset'][name]['metadata']['labels']['app.kubernetes.io/name'] == 'metricbeat' + assert r['daemonset'][name]['spec']['template']['metadata']['labels']['app.kubernetes.io/name'] == 'logstash' def test_setting_fullnameOverride(): config = '''