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:
Kubernetes Submit Queue 2016-08-25 02:36:09 -07:00 committed by GitHub
commit 098c999a8c
2 changed files with 8 additions and 0 deletions

View File

@ -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)

View File

@ -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>"
}