Skip to content

Commit

Permalink
Merge pull request #4700 from TronWallet/fix/nodeport_externalips
Browse files Browse the repository at this point in the history
adds hability to use externalIP when controller service is of type NodePort
  • Loading branch information
k8s-ci-robot authored Nov 26, 2019
2 parents 9f72cb3 + b14a694 commit 95edf02
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/ingress/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,13 @@ func statusAddressFromService(service string, kubeClient clientset.Interface) ([
case apiv1.ServiceTypeClusterIP:
return []string{svc.Spec.ClusterIP}, nil
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:
addresses := []string{}
for _, ip := range svc.Status.LoadBalancer.Ingress {
Expand Down

0 comments on commit 95edf02

Please sign in to comment.