Skip to content
Merged
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
13 changes: 13 additions & 0 deletions build/linux/installer/conf/td-agent-bit-rs.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@
Skip_Long_Lines On
Ignore_Older 2m

[INPUT]
Name tail
Tag oms.container.log.flbplugin.mdsd.*
Path /var/opt/microsoft/linuxmonagent/log/mdsd.err
Read_from_Head true
DB /var/opt/microsoft/docker-cimprov/state/mdsd-ai.db
DB.Sync Off
Parser docker
Mem_Buf_Limit 1m
Path_Key filepath
Skip_Long_Lines On
Ignore_Older 2m

[INPUT]
Name tcp
Tag oms.container.perf.telegraf.*
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ENV KUBE_CLIENT_BACKOFF_BASE 1
ENV KUBE_CLIENT_BACKOFF_DURATION 0
ENV RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR 0.9
RUN /usr/bin/apt-get update && /usr/bin/apt-get install -y libc-bin wget openssl curl sudo python-ctypes init-system-helpers net-tools rsyslog cron vim dmidecode apt-transport-https gnupg && rm -rf /var/lib/apt/lists/*
COPY setup.sh main.sh defaultpromenvvariables defaultpromenvvariables-rs defaultpromenvvariables-sidecar mdsd.xml envmdsd $tmpdir/
COPY setup.sh main.sh defaultpromenvvariables defaultpromenvvariables-rs defaultpromenvvariables-sidecar mdsd.xml envmdsd logrotate.conf $tmpdir/
WORKDIR ${tmpdir}

# copy docker provider shell bundle to use the agent image
Expand Down
39 changes: 39 additions & 0 deletions kubernetes/linux/logrotate.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/var/opt/microsoft/linuxmonagent/log/mdsd.err {
copytruncate
rotate 7
missingok
notifempty
delaycompress
compress
size 10M
}

/var/opt/microsoft/linuxmonagent/log/mdsd.warn {
copytruncate
rotate 7
missingok
notifempty
delaycompress
compress
size 10M
}

/var/opt/microsoft/linuxmonagent/log/mdsd.info {
copytruncate
rotate 7
missingok
notifempty
delaycompress
compress
size 10M
}

/var/opt/microsoft/linuxmonagent/log/mdsd.qos {
copytruncate
rotate 7
missingok
notifempty
delaycompress
compress
size 10M
}
6 changes: 6 additions & 0 deletions kubernetes/linux/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,12 @@ else
mdsd ${MDSD_AAD_MSI_AUTH_ARGS} -e ${MDSD_LOG}/mdsd.err -w ${MDSD_LOG}/mdsd.warn -o ${MDSD_LOG}/mdsd.info -q ${MDSD_LOG}/mdsd.qos &
fi

# Set up a cron job for logrotation
if [ ! -f /etc/cron.d/ci-agent ]; then
echo "setting up cronjob for ci agent log rotation"
echo "*/5 * * * * root /usr/sbin/logrotate -s /var/lib/logrotate/ci-agent-status /etc/logrotate.d/ci-agent >/dev/null 2>&1" > /etc/cron.d/ci-agent
fi

# no dependency on fluentd for prometheus side car container
if [ "${CONTAINER_TYPE}" != "PrometheusSidecar" ]; then
if [ ! -e "/etc/config/kube.conf" ]; then
Expand Down
3 changes: 3 additions & 0 deletions kubernetes/linux/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ wget https://github.com/microsoft/Docker-Provider/releases/download/06242021-one
cp -f $TMPDIR/mdsd.xml /etc/mdsd.d
cp -f $TMPDIR/envmdsd /etc/mdsd.d

#log rotate conf for mdsd and can be extended for other log files as well
cp -f $TMPDIR/logrotate.conf /etc/logrotate.d/ci-agent

#download inotify tools for watching configmap changes
sudo apt-get update
sudo apt-get install inotify-tools -y
Expand Down