mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Merge pull request #31246 from Clarifai/ext-svc-ref
Automatic merge from submit-queue kubectl: display ExternalName for services User-visible part of https://github.com/kubernetes/features/issues/33 Also add ExternalIPs in `describe` cc @thockin @smarterclayton
This commit is contained in:
commit
098c999a8c
@ -1574,6 +1574,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)
|
||||
|
@ -1096,6 +1096,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