Repository navigation
fix(helm): Don't wait for service to be ready when external IP are set - #7530
Conversation
Resolves helm#7513 As the externalIPs are not managed by k8s (according to the doc: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#servicespec-v1-core) helm should not wait for services which set al least one externalIPs. Signed-off-by: Federico Bevione <[email protected]>
|
cc'ing @thomastaylor312 as the resident |
thomastaylor312
left a comment
There was a problem hiding this comment.
This logic looks great. Thank you for tracking this down and fixing. Just a few changes needed around logging messages and clarity
| // This checks if the service has a LoadBalancer and that balancer has an Ingress defined | ||
| (s.Spec.Type == corev1.ServiceTypeLoadBalancer && s.Status.LoadBalancer.Ingress == nil) { | ||
| w.log("Service does not have IP address: %s/%s", s.GetNamespace(), s.GetName()) | ||
| if s.Spec.ClusterIP != corev1.ClusterIPNone && s.Spec.ClusterIP == "" { |
There was a problem hiding this comment.
Can you add back some logging here in this if block to explain why it isn't ready?
There was a problem hiding this comment.
Sorry, my bad. I'm adding back the original message.
However I think it can be made a little more specific, for example: w.log("Service does not have cluster IP address: %s/%s", s.GetNamespace(), s.GetName())
Do you think the original is enough?
There was a problem hiding this comment.
Feel free to make it more specific now that the logic is separated out!
There was a problem hiding this comment.
I've Just pushed a commit with a little improvement of the logs.
If for your is fine, for me it's done.
| if s.Spec.Type == corev1.ServiceTypeLoadBalancer { | ||
| // do not wait when at least 1 external IP is set | ||
| if len(s.Spec.ExternalIPs) > 0 { | ||
| w.log("Service has externaIPs addresses: %s/%s (%v)", s.GetNamespace(), s.GetName(), s.Spec.ExternalIPs) |
There was a problem hiding this comment.
This message should be reworded to something like "Service has external IP addresses, marking service as ready" to be more clear that it is being marked as ready because we don't have a way to ascertain if it is
Signed-off-by: Federico Bevione <[email protected]>
Signed-off-by: Federico Bevione <[email protected]>
thomastaylor312
left a comment
There was a problem hiding this comment.
Looking good. Thanks for the work on this!
Resolves #7513
As, according to the doc, the externalIPs are not managed by k8s; helm should not wait for services which set at least one externalIPs.