Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
177fee13
Commit
177fee13
authored
Sep 21, 2016
by
Fabio Yeon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(GCI) Configure logrotate to rotate all .log files in /var/log.
parent
313ef639
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
configure-helper.sh
cluster/gce/gci/configure-helper.sh
+6
-7
No files found.
cluster/gce/gci/configure-helper.sh
View file @
177fee13
...
...
@@ -103,8 +103,9 @@ function setup-logrotate() {
}
EOF
# Configuration for k8s services that redirect logs to /var/log/<service>.log
# files. Whenever logrotate is ran, this config will:
# Configure log rotation for all logs in /var/log, which is where k8s services
# are configured to write their log files. Whenever logrotate is ran, this
# config will:
# * rotate the log file if its size is > 100Mb OR if one day has elapsed
# * save rotated logs into a gzipped timestamped backup
# * log file timestamp (controlled by 'dateformat') includes seconds too. This
...
...
@@ -112,10 +113,8 @@ EOF
# (otherwise it skips rotation if 'maxsize' is reached multiple times in a
# day).
# * keep only 5 old (rotated) logs, and will discard older logs.
local
logrotate_files
=(
"kube-scheduler"
"kube-proxy"
"kube-apiserver"
"kube-controller-manager"
"kube-addons"
)
for
file
in
"
${
logrotate_files
[@]
}
"
;
do
cat
>
/etc/logrotate.d/
${
file
}
<<
EOF
/var/log/
${
file
}
.log {
cat
>
/etc/logrotate.d/allvarlogs
<<
EOF
/var/log/*.log {
rotate 5
copytruncate
missingok
...
...
@@ -128,7 +127,7 @@ EOF
create 0644 root root
}
EOF
done
}
# Finds the master PD device; returns it in MASTER_PD_DEVICE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment