From 51919dd132b66e2ae7ddcfc3f7e10021f4f54682 Mon Sep 17 00:00:00 2001 From: Grace Wehner Date: Fri, 2 Apr 2021 09:25:01 -0700 Subject: [PATCH 1/4] initial commit --- build/linux/installer/conf/td-agent-bit.conf | 2 +- kubernetes/omsagent.yaml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/build/linux/installer/conf/td-agent-bit.conf b/build/linux/installer/conf/td-agent-bit.conf index 484a4bbbf..11658440c 100644 --- a/build/linux/installer/conf/td-agent-bit.conf +++ b/build/linux/installer/conf/td-agent-bit.conf @@ -15,7 +15,7 @@ Name tail Tag oms.container.log.la.* Path ${AZMON_LOG_TAIL_PATH} - DB /var/log/omsagent-fblogs.db + DB /var/log/container-insights/omsagent-fblogs.db DB.Sync Off Parser docker Mem_Buf_Limit 10m diff --git a/kubernetes/omsagent.yaml b/kubernetes/omsagent.yaml index 206d9a8f0..3905dfa84 100644 --- a/kubernetes/omsagent.yaml +++ b/kubernetes/omsagent.yaml @@ -415,6 +415,9 @@ spec: name: docker-sock - mountPath: /var/log name: host-log + readOnly: true + - mountPath: /var/log/container-insights + name: container-insights-state - mountPath: /var/lib/docker/containers name: containerlog-path readOnly: true @@ -561,6 +564,9 @@ spec: configMap: name: container-azm-ms-osmconfig optional: true + - name: container-insights-state + hostPath: + path: /var/log/container-insights --- apiVersion: apps/v1 kind: Deployment @@ -636,6 +642,7 @@ spec: name: docker-sock - mountPath: /var/log name: host-log + readOnly: true - mountPath: /etc/kubernetes/host name: azure-json-path - mountPath: /etc/omsagent-secret From a96ae17811ef63c197e62f8728ee1d361c029742 Mon Sep 17 00:00:00 2001 From: Grace Wehner Date: Sat, 3 Apr 2021 01:33:51 -0700 Subject: [PATCH 2/4] remove conflicting logrotate settings files --- kubernetes/linux/setup.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kubernetes/linux/setup.sh b/kubernetes/linux/setup.sh index 218e3c717..6f757804b 100644 --- a/kubernetes/linux/setup.sh +++ b/kubernetes/linux/setup.sh @@ -85,3 +85,7 @@ rm -f $TMPDIR/docker-cimprov*.sh rm -f $TMPDIR/azure-mdsd*.deb rm -f $TMPDIR/mdsd.xml rm -f $TMPDIR/envmdsd + +# Remove settings for cron.daily that conflict with the node's cron.daily. Since both are trying to rotate the same files +# in /var/log at the same time, the rotation doesn't happen correctly and then the *.1 file is forever logged to. +rm /etc/logrotate.d/alternatives /etc/logrotate.d/apt /etc/logrotate.d/azure-mdsd /etc/logrotate.d/rsyslog \ No newline at end of file From b1e6ab0f39b18b4a4a78d69e3f4955a39c2e15c7 Mon Sep 17 00:00:00 2001 From: Grace Wehner Date: Sat, 3 Apr 2021 01:38:14 -0700 Subject: [PATCH 3/4] remove readonly changes --- build/linux/installer/conf/td-agent-bit.conf | 2 +- kubernetes/omsagent.yaml | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/build/linux/installer/conf/td-agent-bit.conf b/build/linux/installer/conf/td-agent-bit.conf index 11658440c..484a4bbbf 100644 --- a/build/linux/installer/conf/td-agent-bit.conf +++ b/build/linux/installer/conf/td-agent-bit.conf @@ -15,7 +15,7 @@ Name tail Tag oms.container.log.la.* Path ${AZMON_LOG_TAIL_PATH} - DB /var/log/container-insights/omsagent-fblogs.db + DB /var/log/omsagent-fblogs.db DB.Sync Off Parser docker Mem_Buf_Limit 10m diff --git a/kubernetes/omsagent.yaml b/kubernetes/omsagent.yaml index 3905dfa84..206d9a8f0 100644 --- a/kubernetes/omsagent.yaml +++ b/kubernetes/omsagent.yaml @@ -415,9 +415,6 @@ spec: name: docker-sock - mountPath: /var/log name: host-log - readOnly: true - - mountPath: /var/log/container-insights - name: container-insights-state - mountPath: /var/lib/docker/containers name: containerlog-path readOnly: true @@ -564,9 +561,6 @@ spec: configMap: name: container-azm-ms-osmconfig optional: true - - name: container-insights-state - hostPath: - path: /var/log/container-insights --- apiVersion: apps/v1 kind: Deployment @@ -642,7 +636,6 @@ spec: name: docker-sock - mountPath: /var/log name: host-log - readOnly: true - mountPath: /etc/kubernetes/host name: azure-json-path - mountPath: /etc/omsagent-secret From cbba130dd830c64c5a762d5754775ad95671156f Mon Sep 17 00:00:00 2001 From: Grace Wehner Date: Tue, 6 Apr 2021 09:23:08 -0700 Subject: [PATCH 4/4] add newline to end of file --- kubernetes/linux/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/linux/setup.sh b/kubernetes/linux/setup.sh index 6f757804b..ee3756964 100644 --- a/kubernetes/linux/setup.sh +++ b/kubernetes/linux/setup.sh @@ -88,4 +88,4 @@ rm -f $TMPDIR/envmdsd # Remove settings for cron.daily that conflict with the node's cron.daily. Since both are trying to rotate the same files # in /var/log at the same time, the rotation doesn't happen correctly and then the *.1 file is forever logged to. -rm /etc/logrotate.d/alternatives /etc/logrotate.d/apt /etc/logrotate.d/azure-mdsd /etc/logrotate.d/rsyslog \ No newline at end of file +rm /etc/logrotate.d/alternatives /etc/logrotate.d/apt /etc/logrotate.d/azure-mdsd /etc/logrotate.d/rsyslog