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
73b41944
Commit
73b41944
authored
Aug 01, 2017
by
Shyam Jeedigunta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't stop log-dumping if logexporter fails
parent
b20beaa9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
log-dump.sh
cluster/log-dump/log-dump.sh
+9
-4
No files found.
cluster/log-dump/log-dump.sh
View file @
73b41944
...
@@ -275,7 +275,7 @@ function dump_nodes_with_logexporter() {
...
@@ -275,7 +275,7 @@ function dump_nodes_with_logexporter() {
local
-r
service_account_credentials
=
"
$(
cat
${
GOOGLE_APPLICATION_CREDENTIALS
}
|
base64
|
tr
-d
'\n'
)
"
local
-r
service_account_credentials
=
"
$(
cat
${
GOOGLE_APPLICATION_CREDENTIALS
}
|
base64
|
tr
-d
'\n'
)
"
local
-r
cloud_provider
=
"
${
KUBERNETES_PROVIDER
}
"
local
-r
cloud_provider
=
"
${
KUBERNETES_PROVIDER
}
"
local
-r
enable_hollow_node_logs
=
"
${
ENABLE_HOLLOW_NODE_LOGS
:-
false
}
"
local
-r
enable_hollow_node_logs
=
"
${
ENABLE_HOLLOW_NODE_LOGS
:-
false
}
"
local
-r
logexport_sleep_seconds
=
"
$((
90
+
NUM_NODES
/
10
))
"
local
-r
logexport_sleep_seconds
=
"
$((
90
+
NUM_NODES
/
5
))
"
# Fill in the parameters in the logexporter daemonset template.
# Fill in the parameters in the logexporter daemonset template.
sed
-i
''
-e
"s@{{.LogexporterNamespace}}@
${
logexporter_namespace
}
@g"
"
${
KUBE_ROOT
}
/cluster/log-dump/logexporter-daemonset.yaml"
sed
-i
''
-e
"s@{{.LogexporterNamespace}}@
${
logexporter_namespace
}
@g"
"
${
KUBE_ROOT
}
/cluster/log-dump/logexporter-daemonset.yaml"
...
@@ -286,7 +286,12 @@ function dump_nodes_with_logexporter() {
...
@@ -286,7 +286,12 @@ function dump_nodes_with_logexporter() {
# Create the logexporter namespace, service-account secret and the logexporter daemonset within that namespace.
# Create the logexporter namespace, service-account secret and the logexporter daemonset within that namespace.
KUBECTL
=
"
${
KUBE_ROOT
}
/cluster/kubectl.sh"
KUBECTL
=
"
${
KUBE_ROOT
}
/cluster/kubectl.sh"
"
${
KUBECTL
}
"
create
-f
"
${
KUBE_ROOT
}
/cluster/log-dump/logexporter-daemonset.yaml"
if
!
"
${
KUBECTL
}
"
create
-f
"
${
KUBE_ROOT
}
/cluster/log-dump/logexporter-daemonset.yaml"
;
then
echo
"Failed to create logexporter daemonset.. falling back to logdump through SSH"
"
${
KUBECTL
}
"
delete namespace
"
${
logexporter_namespace
}
"
||
true
dump_nodes
"
${
NODE_NAMES
[@]
}
"
return
fi
# Give some time for the pods to finish uploading logs.
# Give some time for the pods to finish uploading logs.
sleep
"
${
logexport_sleep_seconds
}
"
sleep
"
${
logexport_sleep_seconds
}
"
...
@@ -301,7 +306,7 @@ function dump_nodes_with_logexporter() {
...
@@ -301,7 +306,7 @@ function dump_nodes_with_logexporter() {
echo
"Attempt
${
retry
}
failed to list marker files for succeessful nodes"
echo
"Attempt
${
retry
}
failed to list marker files for succeessful nodes"
if
[[
"
${
retry
}
"
==
10
]]
;
then
if
[[
"
${
retry
}
"
==
10
]]
;
then
echo
"Final attempt to list marker files failed.. falling back to logdump through SSH"
echo
"Final attempt to list marker files failed.. falling back to logdump through SSH"
"
${
KUBECTL
}
"
delete namespace
"
${
logexporter_namespace
}
"
"
${
KUBECTL
}
"
delete namespace
"
${
logexporter_namespace
}
"
||
true
dump_nodes
"
${
NODE_NAMES
[@]
}
"
dump_nodes
"
${
NODE_NAMES
[@]
}
"
return
return
fi
fi
...
@@ -321,7 +326,7 @@ function dump_nodes_with_logexporter() {
...
@@ -321,7 +326,7 @@ function dump_nodes_with_logexporter() {
done
done
# Delete the logexporter resources and dump logs for the failed nodes (if any) through SSH.
# Delete the logexporter resources and dump logs for the failed nodes (if any) through SSH.
"
${
KUBECTL
}
"
delete namespace
"
${
logexporter_namespace
}
"
"
${
KUBECTL
}
"
delete namespace
"
${
logexporter_namespace
}
"
||
true
if
[[
"
${#
failed_nodes
[@]
}
"
!=
0
]]
;
then
if
[[
"
${#
failed_nodes
[@]
}
"
!=
0
]]
;
then
echo
-e
"Dumping logs through SSH for the following nodes:
\n
${
failed_nodes
[@]
}
"
echo
-e
"Dumping logs through SSH for the following nodes:
\n
${
failed_nodes
[@]
}
"
dump_nodes
"
${
failed_nodes
[@]
}
"
dump_nodes
"
${
failed_nodes
[@]
}
"
...
...
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