-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assigning svc CLuster IP when svc is a NodePort #1099
base: main
Are you sure you want to change the base?
Conversation
I'm not sure this is an allowed behaviour, please see kubernetes/kubernetes#119700 |
hey @wasaga, thanks for your time, so I inspired the implementation from nginx-ingress code because we were wondering why it was working for inrgess-nginx and not for pomerium |
if len(svc.Status.LoadBalancer.Ingress) > 0 { | ||
ingress.Status.LoadBalancer.Ingress = svcLoadBalancerStatusToIngress(svc.Status.LoadBalancer.Ingress) | ||
} else if svc.Spec.Type == corev1.ServiceTypeNodePort { | ||
// Assign ClusterIP for NodePort service | ||
if svc.Spec.ClusterIP != "" { | ||
ingress.Status.LoadBalancer.Ingress = append(ingress.Status.LoadBalancer.Ingress, networkingv1.IngressLoadBalancerIngress{ | ||
IP: svc.Spec.ClusterIP, | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- probably this logic should live in
svcLoadBalancerStatusToIngress
- the
if
condition as written would not update the status if we transition from > 0 to 0 - please consider adding a unit test
Summary
Related issues
Checklist
improvement
/bug
/ etc)