Skip to content

Commit

Permalink
🔨 fix: workaround LB public IP route inside k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
anngdinh committed Nov 21, 2024
1 parent 8919362 commit 0c41dc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/ingress/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ func (c *Controller) updateIngressStatus(ing *nwv1.Ingress, lb *lObjects.LoadBal
newState := new(nwv1.IngressLoadBalancerStatus)
addr := net.ParseIP(lb.Address)
if addr != nil {
newState.Ingress = []nwv1.IngressLoadBalancerIngress{{IP: lb.Address}}
newState.Ingress = []nwv1.IngressLoadBalancerIngress{{Hostname: lb.Address + ".nip.io"}}
} else {
newState.Ingress = []nwv1.IngressLoadBalancerIngress{{Hostname: lb.Address}}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/vngcloud/vlb.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ func (c *vLB) createLoadBalancerStatus(pService *corev1.Service, lb *lObjects.Lo
status := &corev1.LoadBalancerStatus{}
addr := net.ParseIP(lb.Address)
if addr != nil {
status.Ingress = []corev1.LoadBalancerIngress{{IP: lb.Address}}
status.Ingress = []corev1.LoadBalancerIngress{{Hostname: lb.Address + ".nip.io"}}
} else {
status.Ingress = []corev1.LoadBalancerIngress{{Hostname: lb.Address}}
}
Expand Down

0 comments on commit 0c41dc1

Please sign in to comment.