Skip to content

fix(helm): Don't wait for service to be ready when external IP are set - #7530

Merged
thomastaylor312 merged 3 commits into
helm:masterfrom
plenus-cloud:fix-7513
Feb 18, 2020
Merged

thomastaylor312 merged 3 commits into
helm:masterfrom
plenus-cloud:fix-7513

Conversation

@FedeBev

@FedeBev FedeBev commented Feb 5, 2020 •

Copy link
Copy Markdown

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.

@helm-bot helm-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 5, 2020
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]>
@bacongobbler

Copy link
Copy Markdown
Member

cc'ing @thomastaylor312 as the resident --wait master

@thomastaylor312 thomastaylor312 added the bug Categorizes issue or PR as related to a bug. label Feb 7, 2020

@thomastaylor312 thomastaylor312 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic looks great. Thank you for tracking this down and fixing. Just a few changes needed around logging messages and clarity

Comment thread pkg/kube/wait.go
// 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 == "" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add back some logging here in this if block to explain why it isn't ready?

@FedeBev FedeBev Feb 7, 2020 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to make it more specific now that the logic is separated out!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've Just pushed a commit with a little improvement of the logs.
If for your is fine, for me it's done.

Comment thread pkg/kube/wait.go Outdated
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@thomastaylor312 thomastaylor312 added this to the 3.1.1 milestone Feb 7, 2020
Federico Bevione added 2 commits February 7, 2020 19:28
Signed-off-by: Federico Bevione <[email protected]>
Signed-off-by: Federico Bevione <[email protected]>

@thomastaylor312 thomastaylor312 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Thanks for the work on this!

@thomastaylor312
thomastaylor312 merged commit 2cd3d12 into helm:master Feb 18, 2020
@thomastaylor312 thomastaylor312 added the needs-pick Indicates that a PR needs to be cherry-picked into the next release candidate. label Feb 18, 2020
@mattfarina mattfarina added the picked Indicates that a PR has been cherry-picked into the next release candidate. label Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Categorizes issue or PR as related to a bug. needs-pick Indicates that a PR needs to be cherry-picked into the next release candidate. picked Indicates that a PR has been cherry-picked into the next release candidate. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timeout 'helm upgrade --wait'

5 participants