Improve kubectl help with examples.

This commit is contained in:
Phillip Wittrock
2017-01-06 12:05:08 -08:00
parent 8ef6902516
commit dc2fffe5d4
10 changed files with 113 additions and 29 deletions

View File

@@ -31,10 +31,16 @@ import (
"github.com/spf13/cobra"
)
var longDescr = templates.LongDesc(`
var (
longDescr = templates.LongDesc(`
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'.`)
clusterinfo_example = templates.Examples(`
# Print the address of the master and cluster services
kubectl cluster-info`)
)
func NewCmdClusterInfo(f cmdutil.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "cluster-info",
@@ -42,6 +48,7 @@ func NewCmdClusterInfo(f cmdutil.Factory, out io.Writer) *cobra.Command {
Aliases: []string{"clusterinfo"},
Short: "Display cluster info",
Long: longDescr,
Example: clusterinfo_example,
Run: func(cmd *cobra.Command, args []string) {
err := RunClusterInfo(f, out, cmd)
cmdutil.CheckErr(err)