Change:
Nice to have for nodePort service debugging, creating manual firewalls, hitting hostNetwork or hostPort pods etc. Currently I need to either -o yaml, --template, or switch to gcloud.
This should be quite easy, should be good for contribution.
I could take a look at this. What information exactly that is available in yaml output should be shown? This is example yaml from my node: There should be an additional address with type , right? Should all types be supported or only external when is used?
-o wide should just dump what we get from the api-server right? What changes should be in kubectl?
-o yaml dumps apiserver outout, -o wide appends useful information at the cost of overflowing 80 chars. I'm asking that -o wide does for nodes what it already does for pods. I currently have such a function in my bash rc: I use it pretty often. That's a signal that more people are probably doing the same.
thanks!

Discussion:
if _, err := fmt.Fprintf(w, "%st%st%s", name, strings.Join(status, ","), translateTimestamp(node.CreationTimestamp)); err != nil { return err } <ins> if options.Wide { if _, err := fmt.Fprintf(w, "t%s", getNodeExternalIP(node)); err != nil { return err } } </ins> // Display caller specify column labels first. if _, err := fmt.Fprint(w, AppendLabels(node.Labels, options.ColumnLabels)); err != nil { return err

return err } <ins> // Returns first external ip of the node or "<none>" if none is found. func getNodeExternalIP(node *api.Node) string { for _, address := range node.Status.Addresses { if address.Type == api.NodeExternalIP { return address.Address } } return "<none>" } </ins> func printNodeList(list *api.NodeList, w io.Writer, options PrintOptions) error { for _, node := range list.Items { if err := printNode(&node, w, options); err != nil {

if t.String() == "*extensions.ReplicaSet" || t.String() == "*extensions.ReplicaSetList" { return []string{"CONTAINER(S)", "IMAGE(S)", "SELECTOR"} } <ins> if t.String() == "*api.Node" || t.String() == "*api.NodeList" { return []string{"EXTERNAL-IP"} } </ins> } return nil }

} } <ins> func TestPrintNodeExternalIP(t *testing.T) { printer := NewHumanReadablePrinter(PrintOptions{ ColumnLabels: []string{}, Wide:         true, }) table := []struct { node       api.Node externalIP string }{ { node: api.Node{ ObjectMeta: api.ObjectMeta{Name: "foo1"}, Status:     api.NodeStatus{Addresses: []api.NodeAddress{{Type: api.NodeExternalIP, Address: "1.1.1.1"}}}, }, externalIP: "1.1.1.1", }, { node: api.Node{ ObjectMeta: api.ObjectMeta{Name: "foo2"}, Status:     api.NodeStatus{Addresses: []api.NodeAddress{{Type: api.NodeInternalIP, Address: "1.1.1.1"}}}, }, externalIP: "<none>", }, { node: api.Node{ ObjectMeta: api.ObjectMeta{Name: "foo3"}, Status: api.NodeStatus{Addresses: []api.NodeAddress{ {Type: api.NodeLegacyHostIP, Address: "1.1.1.1"}, {Type: api.NodeExternalIP, Address: "2.2.2.2"}, {Type: api.NodeInternalIP, Address: "3.3.3.3"}, {Type: api.NodeExternalIP, Address: "4.4.4.4"}, }}, }, externalIP: "2.2.2.2", }, } for _, test := range table { buffer := &bytes.Buffer{} err := printer.PrintObj(&test.node, buffer) if err != nil { t.Fatalf("An error occurred printing Node: %#v", err) } if !contains(strings.Fields(buffer.String()), test.externalIP) { t.Fatalf("Expect printing node %s with external ip %#v, got: %#v", test.node.Name, test.externalIP, buffer.String()) } } } </ins> func contains(fields []string, field string) bool { for _, v := range fields { if v == field {