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
a213886f
Unverified
Commit
a213886f
authored
Mar 12, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Mar 12, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74502 from Random-Liu/collect-pod-log
Collect pod log in fluentd-gcp
parents
eb6a1b65
7ffa7da1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
0 deletions
+31
-0
config-default.sh
cluster/gce/config-default.sh
+8
-0
config-test.sh
cluster/gce/config-test.sh
+8
-0
configure-helper.sh
cluster/gce/gci/configure-helper.sh
+15
-0
No files found.
cluster/gce/config-default.sh
View file @
a213886f
...
@@ -413,6 +413,14 @@ if [[ -n "${LOGROTATE_MAX_SIZE:-}" ]]; then
...
@@ -413,6 +413,14 @@ if [[ -n "${LOGROTATE_MAX_SIZE:-}" ]]; then
PROVIDER_VARS
=
"
${
PROVIDER_VARS
:-}
LOGROTATE_MAX_SIZE"
PROVIDER_VARS
=
"
${
PROVIDER_VARS
:-}
LOGROTATE_MAX_SIZE"
fi
fi
if
[[
-n
"
${
POD_LOG_MAX_FILE
:-}
"
]]
;
then
PROVIDER_VARS
=
"
${
PROVIDER_VARS
:-}
POD_LOG_MAX_FILE"
fi
if
[[
-n
"
${
POD_LOG_MAX_SIZE
:-}
"
]]
;
then
PROVIDER_VARS
=
"
${
PROVIDER_VARS
:-}
POD_LOG_MAX_SIZE"
fi
# Fluentd requirements
# Fluentd requirements
# YAML exists to trigger a configuration refresh when changes are made.
# YAML exists to trigger a configuration refresh when changes are made.
FLUENTD_GCP_YAML_VERSION
=
"v3.2.0"
FLUENTD_GCP_YAML_VERSION
=
"v3.2.0"
...
...
cluster/gce/config-test.sh
View file @
a213886f
...
@@ -432,6 +432,14 @@ if [[ -n "${LOGROTATE_MAX_SIZE:-}" ]]; then
...
@@ -432,6 +432,14 @@ if [[ -n "${LOGROTATE_MAX_SIZE:-}" ]]; then
PROVIDER_VARS
=
"
${
PROVIDER_VARS
:-}
LOGROTATE_MAX_SIZE"
PROVIDER_VARS
=
"
${
PROVIDER_VARS
:-}
LOGROTATE_MAX_SIZE"
fi
fi
if
[[
-n
"
${
POD_LOG_MAX_FILE
:-}
"
]]
;
then
PROVIDER_VARS
=
"
${
PROVIDER_VARS
:-}
POD_LOG_MAX_FILE"
fi
if
[[
-n
"
${
POD_LOG_MAX_SIZE
:-}
"
]]
;
then
PROVIDER_VARS
=
"
${
PROVIDER_VARS
:-}
POD_LOG_MAX_SIZE"
fi
# Fluentd requirements
# Fluentd requirements
# YAML exists to trigger a configuration refresh when changes are made.
# YAML exists to trigger a configuration refresh when changes are made.
FLUENTD_GCP_YAML_VERSION
=
"v3.2.0"
FLUENTD_GCP_YAML_VERSION
=
"v3.2.0"
...
...
cluster/gce/gci/configure-helper.sh
View file @
a213886f
...
@@ -374,6 +374,21 @@ function setup-logrotate() {
...
@@ -374,6 +374,21 @@ function setup-logrotate() {
}
}
EOF
EOF
# Configure log rotation for pod logs in /var/log/pods/NAMESPACE_NAME_UID.
cat
>
/etc/logrotate.d/allpodlogs
<<
EOF
/var/log/pods/*/*.log {
rotate
${
POD_LOG_MAX_FILE
:-
5
}
copytruncate
missingok
notifempty
compress
maxsize
${
POD_LOG_MAX_SIZE
:-
5M
}
daily
dateext
dateformat -%Y%m%d-%s
create 0644 root root
}
EOF
}
}
# Finds the master PD device; returns it in MASTER_PD_DEVICE
# 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