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
f195a80e
Commit
f195a80e
authored
Aug 10, 2015
by
Alex Robinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12494 from mesosphere/mesos-docker-log-dump
[mesos/docker] Dump logs on kube-up error
parents
d6b7fcc6
9a415f96
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
.gitignore
cluster/mesos/docker/.gitignore
+1
-0
util.sh
cluster/mesos/docker/util.sh
+16
-7
No files found.
cluster/mesos/docker/.gitignore
View file @
f195a80e
certs
certs
logs
cluster/mesos/docker/util.sh
View file @
f195a80e
...
@@ -26,6 +26,7 @@ set -o pipefail
...
@@ -26,6 +26,7 @@ set -o pipefail
KUBE_ROOT
=
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../../.."
&&
pwd
)
KUBE_ROOT
=
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../../.."
&&
pwd
)
provider_root
=
"
${
KUBE_ROOT
}
/cluster/
${
KUBERNETES_PROVIDER
}
"
provider_root
=
"
${
KUBE_ROOT
}
/cluster/
${
KUBERNETES_PROVIDER
}
"
compose_file
=
"
${
provider_root
}
/docker-compose.yml"
source
"
${
provider_root
}
/
${
KUBE_CONFIG_FILE
-
"config-default.sh"
}
"
source
"
${
provider_root
}
/
${
KUBE_CONFIG_FILE
-
"config-default.sh"
}
"
source
"
${
KUBE_ROOT
}
/cluster/common.sh"
source
"
${
KUBE_ROOT
}
/cluster/common.sh"
...
@@ -184,10 +185,11 @@ function kube-up {
...
@@ -184,10 +185,11 @@ function kube-up {
echo
"Creating admin basic auth user"
1>&2
echo
"Creating admin basic auth user"
1>&2
cluster::mesos::docker::create_basic_user
"admin"
"admin"
>
"
${
apiserver_certs_dir
}
/basic-users"
cluster::mesos::docker::create_basic_user
"admin"
"admin"
>
"
${
apiserver_certs_dir
}
/basic-users"
# log dump on failure
trap
'cluster::mesos::docker::dump_logs'
ERR
echo
"Starting
${
KUBERNETES_PROVIDER
}
cluster"
1>&2
echo
"Starting
${
KUBERNETES_PROVIDER
}
cluster"
1>&2
pushd
"
${
provider_root
}
"
>
/dev/null
docker-compose
-f
"
${
compose_file
}
"
up
-d
docker-compose up
-d
popd
>
/dev/null
detect-master
detect-master
detect-minions
detect-minions
...
@@ -228,11 +230,9 @@ function validate-cluster {
...
@@ -228,11 +230,9 @@ function validate-cluster {
# Delete a kubernetes cluster
# Delete a kubernetes cluster
function
kube-down
{
function
kube-down
{
echo
"Stopping
${
KUBERNETES_PROVIDER
}
cluster"
1>&2
echo
"Stopping
${
KUBERNETES_PROVIDER
}
cluster"
1>&2
pushd
"
${
provider_root
}
"
>
/dev/null
# Since restoring a stopped cluster is not yet supported, use the nuclear option
# Since restoring a stopped cluster is not yet supported, use the nuclear option
docker-compose
kill
docker-compose
-f
"
${
compose_file
}
"
kill
docker-compose
rm
-f
docker-compose
-f
"
${
compose_file
}
"
rm
-f
popd
>
/dev/null
}
}
function
test-setup
{
function
test-setup
{
...
@@ -293,3 +293,12 @@ function cluster::mesos::docker::addon_status {
...
@@ -293,3 +293,12 @@ function cluster::mesos::docker::addon_status {
phase
=
"
${
phase
:-
Unknown
}
"
phase
=
"
${
phase
:-
Unknown
}
"
echo
"
${
phase
}
"
echo
"
${
phase
}
"
}
}
function
cluster::mesos::docker::dump_logs
{
local
log_dir
=
"
${
provider_root
}
/logs"
echo
"Dumping logs to '
${
log_dir
}
'"
1>&2
mkdir
-p
"
${
log_dir
}
"
while
read
name
;
do
docker logs
"
${
name
}
"
&>
"
${
log_dir
}
/
${
name
}
.log"
done
< <
(
docker-compose
-f
"
${
compose_file
}
"
ps
-q
| xargs docker inspect
--format
'{{.Name}}'
)
}
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