mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
kubectl: display ExternalName for services
Also add ExternalIPs in `describe`
This commit is contained in:
parent
e5fbea62c6
commit
42e1e7aed4
@ -1562,6 +1562,12 @@ func describeService(service *api.Service, endpoints *api.Endpoints, events *api
|
||||
fmt.Fprintf(out, "Selector:\t%s\n", labels.FormatLabels(service.Spec.Selector))
|
||||
fmt.Fprintf(out, "Type:\t%s\n", service.Spec.Type)
|
||||
fmt.Fprintf(out, "IP:\t%s\n", service.Spec.ClusterIP)
|
||||
if len(service.Spec.ExternalIPs) > 0 {
|
||||
fmt.Fprintf(out, "External IPs:\t%v\n", strings.Join(service.Spec.ExternalIPs, ","))
|
||||
}
|
||||
if service.Spec.ExternalName != "" {
|
||||
fmt.Fprintf(out, "External Name:\t%s\n", service.Spec.ExternalName)
|
||||
}
|
||||
if len(service.Status.LoadBalancer.Ingress) > 0 {
|
||||
list := buildIngressString(service.Status.LoadBalancer.Ingress)
|
||||
fmt.Fprintf(out, "LoadBalancer Ingress:\t%s\n", list)
|
||||
|
@ -1092,6 +1092,8 @@ func getServiceExternalIP(svc *api.Service, wide bool) string {
|
||||
return lbIps
|
||||
}
|
||||
return "<pending>"
|
||||
case api.ServiceTypeExternalName:
|
||||
return svc.Spec.ExternalName
|
||||
}
|
||||
return "<unknown>"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user