Skip to content

Timeout 'helm upgrade --wait' #7513

Closed

Description

@ArieGato

Output of helm version:

version.BuildInfo{Version:"v3.0.3", GitCommit:"ac925eb7279f4a6955df663a0128044a8a6b7593", GitTreeState:"clean", GoVersion:"go1.13.6"}

Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.2", GitCommit:"59603c6e503c87169aea6106f57b9f242f64df89", GitTreeState:"clean", BuildDate:"2020-01-18T23:30:10Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.2", GitCommit:"59603c6e503c87169aea6106f57b9f242f64df89", GitTreeState:"clean", BuildDate:"2020-01-18T23:22:30Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}

Cloud Provider/Platform (AKS, GKE, Minikube etc.):

I created a helm chart to run in a release pipeline in devops with the flag --wait. The build task times out and with --debug flag it continuously shows:

2020-02-03T07:46:29.3015941Z wait.go:182: [debug] Service does not have IP address: ******

But when I check the service in k8s it is running and functioning properly.

This is the output of --dry-run:

# Source: identityserver/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  name: identityserver
  labels:
    app: identityserver
    chart: identityserver-0.1.0
    release: identityserver-1580717645
    heritage: Helm
spec:
  type: LoadBalancer
  ports:
    - port: 80
      targetPort: http
      protocol: TCP
      name: http
  externalIPs:
    - 172.16.253.90
  selector:
    app: identityserver
    release: identityserver-1580717645

Activity

  1. bacongobbler commented on Feb 3, 2020

    @bacongobbler
    Member

    Can you check your service inside the cluster to see if it has a clusterIP defined? That particular error points to a section of the code where it checks if a clusterIP is defined. If you found an edge case, would you mind writing a patch and possibly a test case to confirm this? Thanks!

    Here's the code:

    helm/pkg/kube/wait.go

    Lines 190 to 196 in d8a32d6

    // Make sure the service is not explicitly set to "None" before checking the IP
    if (s.Spec.ClusterIP != corev1.ClusterIPNone && s.Spec.ClusterIP == "") ||
    // 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())
    return false
    }

  2. ArieGato commented on Feb 4, 2020

    @ArieGato
    Author

    It appears to have a clusterIP. Here's the info I get:

    PS C:\Windows\system32> kubectl get svc identityserver
    NAME             TYPE           CLUSTER-IP     EXTERNAL-IP     PORT(S)                      AGE
    identityserver   LoadBalancer   10.97.18.188   172.16.253.90   80:31824/TCP,443:30141/TCP   5m24s
    
    PS C:\Windows\system32> kubectl describe svc identityserver
    Name:                     identityserver
    Namespace:                default
    Labels:                   app=identityserver
                              chart=identityserver-8846
                              heritage=Helm
                              release=identityserver-dev
    Annotations:              <none>
    Selector:                 app=identityserver,release=identityserver-dev
    Type:                     LoadBalancer
    IP:                       10.97.18.188
    External IPs:             172.16.253.90
    Port:                     http  80/TCP
    TargetPort:               80/TCP
    NodePort:                 http  31824/TCP
    Endpoints:                10.244.2.20:80
    Port:                     https  443/TCP
    TargetPort:               443/TCP
    NodePort:                 https  30141/TCP
    Endpoints:                10.244.2.20:443
    Session Affinity:         None
    External Traffic Policy:  Cluster
    Events:                   <none>
    

    The failing condition appears to be:
    s.Status.LoadBalancer.Ingress == nil

    I'm unfamiliar with helm. How do I 'write a patch'? Is there a way to get verbose information of object s?

    ps. I followed the developers guide, but the make file doesn't seem to work on Windows. Any suggestions?

  3. FedeBev commented on Feb 5, 2020

    @FedeBev

    I'm facing the same problem.

    The kubernetes reference says: externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system.

    For that reason, when externalIPs is used and --wait flag is set, helm should not wait for .Status.LoadBalancer.Ingress to be different from nil

    Possible solution

    Changing the condition of serviceReady function with something similar to the following code should be enough:

    // Make sure the service is not explicitly set to "None" before checking the IP
    if s.Spec.ClusterIP != corev1.ClusterIPNone && s.Spec.ClusterIP == "" {
    	return false
    }
    
    // This checks if the service has a LoadBalancer and that balancer has an Ingress defined
    if s.Spec.Type == corev1.ServiceTypeLoadBalancer {
    	if len(s.Spec.ExternalIPs) > 0 {
    		w.log("Service has externaIPs addresses: %s/%s (%v)", s.GetNamespace(), s.GetName(), s.Spec.ExternalIPs)
    		return true
    	}
    
    	if s.Status.LoadBalancer.Ingress == nil {
    		w.log("Service does not have IP address: %s/%s", s.GetNamespace(), s.GetName())
    		return false
    	}
    }



    @bacongobbler you labeled the issue as question but I think is a bug, what do you think?

    If a PR is welcome I can deal with that in a while.

  4. added 2 commits that reference this issue on Feb 5, 2020
    d3dd719
    438eaec
  5. added
    bug
    and removed on Feb 7, 2020
  6. added this to the 3.1.1 milestone on Feb 7, 2020
  7. added a commit that references this issue on Feb 20, 2020
    30ebfaf
  8. added 3 commits that reference this issue on Feb 28, 2020
    455bd1a
    02afcdf
    2d5658a
  9. added a commit that references this issue on May 8, 2020
    f68c282
  10. added a commit that references this issue on Oct 2, 2020
    015c07f
  11. hazcod commented on Jan 7, 2021

    @hazcod

    I am having the same issue with version.BuildInfo{Version:"v3.4.2", GitCommit:"23dd3af5e19a02d4f4baa5b2f242645a1a3af629", GitTreeState:"dirty", GoVersion:"go1.15.5"} on Kubernetes via Docker for Mac.

    wait.go:53: [debug] beginning wait for 3 resources with timeout of 5m0s
    wait.go:206: [debug] Service does not have load balancer ingress IP address: 
    

    Could be unrelated since external-ip stays pending?

    NAME       TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
    backend    LoadBalancer   10.110.36.195   <pending>     9300:32716/TCP   9m57s
    frontend   LoadBalancer   10.98.164.228   localhost     9300:31655/TCP   10m
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions