mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Add PortalIP to Service describe
This commit is contained in:
parent
86a0193f51
commit
36f19f77ec
@ -268,8 +268,14 @@ func (d *ServiceDescriber) Describe(namespace, name string) (string, error) {
|
|||||||
fmt.Fprintf(out, "Name:\t%s\n", service.Name)
|
fmt.Fprintf(out, "Name:\t%s\n", service.Name)
|
||||||
fmt.Fprintf(out, "Labels:\t%s\n", formatLabels(service.Labels))
|
fmt.Fprintf(out, "Labels:\t%s\n", formatLabels(service.Labels))
|
||||||
fmt.Fprintf(out, "Selector:\t%s\n", formatLabels(service.Spec.Selector))
|
fmt.Fprintf(out, "Selector:\t%s\n", formatLabels(service.Spec.Selector))
|
||||||
|
fmt.Fprintf(out, "IP:\t%s\n", service.Spec.PortalIP)
|
||||||
|
if len(service.Spec.PublicIPs) > 0 {
|
||||||
|
list := strings.Join(service.Spec.PublicIPs, ", ")
|
||||||
|
fmt.Fprintf(out, "Public IPs:\t%s\n", list)
|
||||||
|
}
|
||||||
fmt.Fprintf(out, "Port:\t%d\n", service.Spec.Port)
|
fmt.Fprintf(out, "Port:\t%d\n", service.Spec.Port)
|
||||||
fmt.Fprintf(out, "Endpoints:\t%s\n", formatEndpoints(endpoints.Endpoints))
|
fmt.Fprintf(out, "Endpoints:\t%s\n", formatEndpoints(endpoints.Endpoints))
|
||||||
|
fmt.Fprintf(out, "Session Affinity:\t%s\n", service.Spec.SessionAffinity)
|
||||||
if events != nil {
|
if events != nil {
|
||||||
describeEvents(events, out)
|
describeEvents(events, out)
|
||||||
}
|
}
|
||||||
|
@ -267,7 +267,7 @@ func (h *HumanReadablePrinter) printHeader(columnNames []string, w io.Writer) er
|
|||||||
|
|
||||||
func formatEndpoints(endpoints []api.Endpoint) string {
|
func formatEndpoints(endpoints []api.Endpoint) string {
|
||||||
if len(endpoints) == 0 {
|
if len(endpoints) == 0 {
|
||||||
return "<empty>"
|
return "<none>"
|
||||||
}
|
}
|
||||||
list := []string{}
|
list := []string{}
|
||||||
for i := range endpoints {
|
for i := range endpoints {
|
||||||
|
Loading…
Reference in New Issue
Block a user