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
178b5f76
Commit
178b5f76
authored
May 16, 2016
by
Brendan Burns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address comments
parent
d8daa07f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
18 deletions
+66
-18
kubectl-cluster-info-dump.1
docs/man/man1/kubectl-cluster-info-dump.1
+25
-0
kubectl-cluster-info.1
docs/man/man1/kubectl-cluster-info.1
+1
-0
kubectl_cluster-info.md
docs/user-guide/kubectl/kubectl_cluster-info.md
+2
-1
kubectl_cluster-info_dump.md
docs/user-guide/kubectl/kubectl_cluster-info_dump.md
+20
-1
kubectl_cluster-info.yaml
docs/yaml/kubectl/kubectl_cluster-info.yaml
+2
-1
clusterinfo_dump.go
pkg/kubectl/cmd/clusterinfo_dump.go
+12
-11
clusterinfo_dump_test.go
pkg/kubectl/cmd/clusterinfo_dump_test.go
+4
-4
No files found.
docs/man/man1/kubectl-cluster-info-dump.1
View file @
178b5f76
...
...
@@ -18,6 +18,10 @@ stdout. You can optionally specify a directory with \-\-output\-directory. If y
build a set of files in that directory. By default only dumps things in the 'kube\-system' namespace, but you can
switch to a different namespace with the \-\-namespaces flag, or specify \-\-all\-namespaces to dump all namespaces.
.PP
The command also dumps the logs of all of the pods in the cluster, these logs are dumped into different directories
based on namespace and pod name.
.SH OPTIONS
.PP
...
...
@@ -131,6 +135,27 @@ switch to a different namespace with the \-\-namespaces flag, or specify \-\-all
comma\-separated list of pattern=N settings for file\-filtered logging
.SH EXAMPLE
.PP
.RS
.nf
# Dump current cluster state to stdout
kubectl cluster\-info dump
# Dump current cluster state to /path/to/cluster\-state
kubectl cluster\-info dump \-\-output\-directory=/path/to/cluster\-state
# Dump all namespaces to stdout
kubectl cluster\-info dump \-\-all\-namespaces
# Dump a set of namespaces to /path/to/cluster\-state
kubectl cluster\-info dump \-\-namespaces default,kube\-system \-\-output\-directory=/path/to/cluster\-state
.fi
.RE
.SH SEE ALSO
.PP
\fBkubectl\-cluster\-info(1)\fP,
...
...
docs/man/man1/kubectl-cluster-info.1
View file @
178b5f76
...
...
@@ -14,6 +14,7 @@ kubectl cluster\-info \- Display cluster info
.SH DESCRIPTION
.PP
Display addresses of the master and services with label kubernetes.io/cluster\-service=true
To further debug and diagnose cluster problems, use 'kubectl cluster\-info dump'.
.SH OPTIONS
...
...
docs/user-guide/kubectl/kubectl_cluster-info.md
View file @
178b5f76
...
...
@@ -40,6 +40,7 @@ Display cluster info
Display addresses of the master and services with label kubernetes.io/cluster-service=true
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
```
kubectl cluster-info
...
...
@@ -84,7 +85,7 @@ kubectl cluster-info
*
[
kubectl
](
kubectl.md
)
- kubectl controls the Kubernetes cluster manager
*
[
kubectl cluster-info dump
](
kubectl_cluster-info_dump.md
)
- Dump lots of relevant info for debugging and diagnosis.
###### Auto generated by spf13/cobra on
27-Apr
-2016
###### Auto generated by spf13/cobra on
16-May
-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[

]()
...
...
docs/user-guide/kubectl/kubectl_cluster-info_dump.md
View file @
178b5f76
...
...
@@ -40,9 +40,28 @@ stdout. You can optionally specify a directory with --output-directory. If you
build a set of files in that directory. By default only dumps things in the 'kube-system' namespace, but you can
switch to a different namespace with the --namespaces flag, or specify --all-namespaces to dump all namespaces.
The command also dumps the logs of all of the pods in the cluster, these logs are dumped into different directories
based on namespace and pod name.
```
kubectl cluster-info dump
```
### Examples
```
# Dump current cluster state to stdout
kubectl cluster-info dump
# Dump current cluster state to /path/to/cluster-state
kubectl cluster-info dump --output-directory=/path/to/cluster-state
# Dump all namespaces to stdout
kubectl cluster-info dump --all-namespaces
# Dump a set of namespaces to /path/to/cluster-state
kubectl cluster-info dump --namespaces default,kube-system --output-directory=/path/to/cluster-state
```
### Options
...
...
@@ -85,7 +104,7 @@ kubectl cluster-info dump
*
[
kubectl cluster-info
](
kubectl_cluster-info.md
)
- Display cluster info
###### Auto generated by spf13/cobra on
27-Apr
-2016
###### Auto generated by spf13/cobra on
16-May
-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[

]()
...
...
docs/yaml/kubectl/kubectl_cluster-info.yaml
View file @
178b5f76
name
:
cluster-info
synopsis
:
Display cluster info
description
:
|
description
:
|
-
Display addresses of the master and services with label kubernetes.io/cluster-service=true
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
o
ptions:
-
name: include-extended-apis
default_value: "true"
...
...
pkg/kubectl/cmd/clusterinfo_dump.go
View file @
178b5f76
...
...
@@ -33,9 +33,10 @@ import (
// NewCmdCreateSecret groups subcommands to create various types of secrets
func
NewCmdClusterInfoDump
(
f
*
cmdutil
.
Factory
,
cmdOut
io
.
Writer
)
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"dump"
,
Short
:
"Dump lots of relevant info for debugging and diagnosis."
,
Long
:
dumpLong
+
"
\n
"
+
dumpExample
,
Use
:
"dump"
,
Short
:
"Dump lots of relevant info for debugging and diagnosis."
,
Long
:
dumpLong
,
Example
:
dumpExample
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
cmdutil
.
CheckErr
(
dumpClusterInfo
(
f
,
cmd
,
args
,
cmdOut
))
},
...
...
@@ -57,17 +58,17 @@ The command also dumps the logs of all of the pods in the cluster, these logs ar
based on namespace and pod name.
`
dumpExample
=
`
# Dump current cluster state to stdout
kubectl cluster-info dump
dumpExample
=
`# Dump current cluster state to stdout
kubectl cluster-info dump
# Dump current cluster state to /path/to/cluster-state
kubectl cluster-info dump --output-directory=/path/to/cluster-state
# Dump current cluster state to /path/to/cluster-state
kubectl cluster-info dump --output-directory=/path/to/cluster-state
# Dump all namespaces to stdout
kubectl cluster-info dump --all-namespaces
# Dump all namespaces to stdout
kubectl cluster-info dump --all-namespaces
# Dump a set of namespaces to /path/to/cluster-state
kubectl cluster-info dump --namespaces default,kube-system --output-directory=/path/to/cluster-state`
# Dump a set of namespaces to /path/to/cluster-state
kubectl cluster-info dump --namespaces default,kube-system --output-directory=/path/to/cluster-state`
)
func
setupOutputWriter
(
cmd
*
cobra
.
Command
,
defaultWriter
io
.
Writer
,
filename
string
)
io
.
Writer
{
...
...
pkg/kubectl/cmd/clusterinfo_dump_test.go
View file @
178b5f76
...
...
@@ -24,21 +24,21 @@ import (
"testing"
)
func
Test
Ge
tWriterNoOp
(
t
*
testing
.
T
)
{
func
Test
SetupOutpu
tWriterNoOp
(
t
*
testing
.
T
)
{
tests
:=
[]
string
{
""
,
"-"
}
for
_
,
test
:=
range
tests
{
out
:=
&
bytes
.
Buffer
{}
f
,
_
,
_
:=
NewAPIFactory
()
cmd
:=
NewCmdClusterInfoDump
(
f
,
os
.
Stdout
)
cmd
.
Flag
(
"output-directory"
)
.
Value
.
Set
(
test
)
writer
:=
ge
tWriter
(
cmd
,
out
,
"/some/file/that/should/be/ignored"
)
writer
:=
setupOutpu
tWriter
(
cmd
,
out
,
"/some/file/that/should/be/ignored"
)
if
writer
!=
out
{
t
.
Errorf
(
"expected: %v, saw: %v"
,
out
,
writer
)
}
}
}
func
Test
Ge
tWriterFile
(
t
*
testing
.
T
)
{
func
Test
SetupOutpu
tWriterFile
(
t
*
testing
.
T
)
{
file
:=
"output.json"
dir
,
err
:=
ioutil
.
TempDir
(
os
.
TempDir
(),
"out"
)
if
err
!=
nil
{
...
...
@@ -51,7 +51,7 @@ func TestGetWriterFile(t *testing.T) {
f
,
_
,
_
:=
NewAPIFactory
()
cmd
:=
NewCmdClusterInfoDump
(
f
,
os
.
Stdout
)
cmd
.
Flag
(
"output-directory"
)
.
Value
.
Set
(
dir
)
writer
:=
ge
tWriter
(
cmd
,
out
,
file
)
writer
:=
setupOutpu
tWriter
(
cmd
,
out
,
file
)
if
writer
==
out
{
t
.
Errorf
(
"expected: %v, saw: %v"
,
out
,
writer
)
}
...
...
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