Merge pull request #4700 from TronWallet/fix/nodeport_externalips
adds hability to use externalIP when controller service is of type NodePort
This commit is contained in:
commit
95edf02f91
1 changed files with 7 additions and 1 deletions
|
@ -338,7 +338,13 @@ func statusAddressFromService(service string, kubeClient clientset.Interface) ([
|
||||||
case apiv1.ServiceTypeClusterIP:
|
case apiv1.ServiceTypeClusterIP:
|
||||||
return []string{svc.Spec.ClusterIP}, nil
|
return []string{svc.Spec.ClusterIP}, nil
|
||||||
case apiv1.ServiceTypeNodePort:
|
case apiv1.ServiceTypeNodePort:
|
||||||
return []string{svc.Spec.ClusterIP}, nil
|
addresses := []string{}
|
||||||
|
if svc.Spec.ExternalIPs != nil {
|
||||||
|
addresses = append(addresses, svc.Spec.ExternalIPs...)
|
||||||
|
} else {
|
||||||
|
addresses = append(addresses, svc.Spec.ClusterIP)
|
||||||
|
}
|
||||||
|
return addresses, nil
|
||||||
case apiv1.ServiceTypeLoadBalancer:
|
case apiv1.ServiceTypeLoadBalancer:
|
||||||
addresses := []string{}
|
addresses := []string{}
|
||||||
for _, ip := range svc.Status.LoadBalancer.Ingress {
|
for _, ip := range svc.Status.LoadBalancer.Ingress {
|
||||||
|
|
Loading…
Reference in a new issue