From 192cba543f46588353da23eb289ea8b291cb3ac8 Mon Sep 17 00:00:00 2001 From: Niklas <49809019+nluedema@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:36:43 +0200 Subject: [PATCH 1/5] [newrelic-logging] Adjust order of env list in daemonset When using persistentVolume mode, the env variable FB_DB references NODE_NAME. This reference is currently not resolved, because NODE_NAME is defined after FB_DB. This commit fixes this, by moving the definition of NODE_NAME before the definition of FB_DB. --- charts/newrelic-logging/templates/daemonset.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/charts/newrelic-logging/templates/daemonset.yaml b/charts/newrelic-logging/templates/daemonset.yaml index 1bc779a99..ba1a44d3b 100644 --- a/charts/newrelic-logging/templates/daemonset.yaml +++ b/charts/newrelic-logging/templates/daemonset.yaml @@ -93,6 +93,11 @@ spec: {{- else }} value: "docker,cri" {{- end }} + # NODE_NAME needs to be defined before FB_DB, because FB_DB references NODE_NAME in its value when using persistentVolume + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName {{- if or (not .Values.fluentBit.persistence) (eq .Values.fluentBit.persistence.mode "hostPath") }} - name: FB_DB value: {{ .Values.fluentBit.db | quote }} @@ -113,10 +118,6 @@ spec: value: {{ include "newrelic-logging.lowDataMode" . | default "false" | quote }} - name: RETRY_LIMIT value: {{ .Values.fluentBit.retryLimit | quote }} - - name: NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - name: HOSTNAME valueFrom: fieldRef: From 3b7a1b5fa2e3fe78e3e86b6403680e7912b7665f Mon Sep 17 00:00:00 2001 From: Niklas <49809019+nluedema@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:55:09 +0200 Subject: [PATCH 2/5] [newrelic-logging] Bump chart version --- charts/newrelic-logging/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/newrelic-logging/Chart.yaml b/charts/newrelic-logging/Chart.yaml index df24625d3..ab809e33c 100644 --- a/charts/newrelic-logging/Chart.yaml +++ b/charts/newrelic-logging/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: A Helm chart to deploy New Relic Kubernetes Logging as a DaemonSet, supporting both Linux and Windows nodes and containers name: newrelic-logging -version: 1.22.3 +version: 1.22.4 appVersion: 2.0.0 home: https://github.com/newrelic/kubernetes-logging icon: https://newrelic.com/assets/newrelic/source/NewRelic-logo-square.svg From 38f31372111e1598d28ff8c46369b87ebc4c1a42 Mon Sep 17 00:00:00 2001 From: "Luedemann Niklas (HC/XAD1.3)" Date: Tue, 15 Oct 2024 17:24:48 +0200 Subject: [PATCH 3/5] Revert "[newrelic-logging] Bump chart version" This reverts commit 3b7a1b5fa2e3fe78e3e86b6403680e7912b7665f. --- charts/newrelic-logging/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/newrelic-logging/Chart.yaml b/charts/newrelic-logging/Chart.yaml index ab809e33c..df24625d3 100644 --- a/charts/newrelic-logging/Chart.yaml +++ b/charts/newrelic-logging/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: A Helm chart to deploy New Relic Kubernetes Logging as a DaemonSet, supporting both Linux and Windows nodes and containers name: newrelic-logging -version: 1.22.4 +version: 1.22.3 appVersion: 2.0.0 home: https://github.com/newrelic/kubernetes-logging icon: https://newrelic.com/assets/newrelic/source/NewRelic-logo-square.svg From 648c0a9c49cd61efd1d0563e0c39118c6c7e69e0 Mon Sep 17 00:00:00 2001 From: "Luedemann Niklas (HC/XAD1.3)" Date: Tue, 15 Oct 2024 17:25:03 +0200 Subject: [PATCH 4/5] Revert "[newrelic-logging] Adjust order of env list in daemonset" This reverts commit 192cba543f46588353da23eb289ea8b291cb3ac8. --- charts/newrelic-logging/templates/daemonset.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/charts/newrelic-logging/templates/daemonset.yaml b/charts/newrelic-logging/templates/daemonset.yaml index ba1a44d3b..1bc779a99 100644 --- a/charts/newrelic-logging/templates/daemonset.yaml +++ b/charts/newrelic-logging/templates/daemonset.yaml @@ -93,11 +93,6 @@ spec: {{- else }} value: "docker,cri" {{- end }} - # NODE_NAME needs to be defined before FB_DB, because FB_DB references NODE_NAME in its value when using persistentVolume - - name: NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName {{- if or (not .Values.fluentBit.persistence) (eq .Values.fluentBit.persistence.mode "hostPath") }} - name: FB_DB value: {{ .Values.fluentBit.db | quote }} @@ -118,6 +113,10 @@ spec: value: {{ include "newrelic-logging.lowDataMode" . | default "false" | quote }} - name: RETRY_LIMIT value: {{ .Values.fluentBit.retryLimit | quote }} + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName - name: HOSTNAME valueFrom: fieldRef: From d8cc15a11cbfac1b5a44ce71d9ab65ea4ea175e3 Mon Sep 17 00:00:00 2001 From: "Luedemann Niklas (HC/XAD1.3)" Date: Tue, 15 Oct 2024 17:36:52 +0200 Subject: [PATCH 5/5] [newrelic-logging] Fix FB_DB env variable being dependent on definition order The FB_DB environment variable depends on the environment variable NODE_NAME. This variable is currently resolved by Helm, which makes FB_DB depend on the environment variable definition order. To fix this, we make NODE_NAME being resolved by Fluent Bit instead of Helm. --- charts/newrelic-logging/Chart.yaml | 2 +- charts/newrelic-logging/templates/daemonset.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/newrelic-logging/Chart.yaml b/charts/newrelic-logging/Chart.yaml index b53bfac78..03c020283 100644 --- a/charts/newrelic-logging/Chart.yaml +++ b/charts/newrelic-logging/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: A Helm chart to deploy New Relic Kubernetes Logging as a DaemonSet, supporting both Linux and Windows nodes and containers name: newrelic-logging -version: 1.23.0 +version: 1.23.1 appVersion: 2.0.2 home: https://github.com/newrelic/kubernetes-logging icon: https://newrelic.com/assets/newrelic/source/NewRelic-logo-square.svg diff --git a/charts/newrelic-logging/templates/daemonset.yaml b/charts/newrelic-logging/templates/daemonset.yaml index 7dac9e07e..3abeaf2ff 100644 --- a/charts/newrelic-logging/templates/daemonset.yaml +++ b/charts/newrelic-logging/templates/daemonset.yaml @@ -101,7 +101,7 @@ spec: value: {{ .Values.fluentBit.db | quote }} {{- else if eq .Values.fluentBit.persistence.mode "persistentVolume" }} - name: FB_DB - value: "/db/$(NODE_NAME)-fb.db" + value: "/db/${NODE_NAME}-fb.db" {{- else }} - name: FB_DB value: ""