Skip to content
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

WIP: Add function to allow custom values in Ingress status #985

Closed
wants to merge 1 commit into from

Conversation

aledbf
Copy link
Member

@aledbf aledbf commented Jul 17, 2017

ping @bigkraig

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 17, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@bigkraig
Copy link
Contributor

👍 I am able to configure the ingress address now. thanks!!

@aledbf
Copy link
Member Author

aledbf commented Jul 17, 2017

/retest

@aledbf aledbf closed this Jul 17, 2017
@aledbf aledbf reopened this Jul 17, 2017
@bigkraig
Copy link
Contributor

bigkraig commented Jul 17, 2017

@aledbf hold off on merging this. I am looking into an issue that occurs when I return nil. Rather than having the address set to the IPs of the nodes, it is set to the most recent return of UpdateIngressStatus

I0717 12:05:22.454378   21011 log.go:48] [ALB-INGRESS] [prd426-prom-alertmanager] [INFO]: 1 internal-dev-cf98cfacafd7a77-1375784819.us-east-1.elb.amazonaws.com
I0717 12:05:22.454655   21011 log.go:62] [ALB-INGRESS] [prd354-raphaeld-quaffing-joey-exampleapp] [ERROR]: No ALB hostnames for ingress
I0717 12:05:22.454667   21011 status.go:317] updating Ingress prd354-raphaeld/quaffing-joey-exampleapp status to [{ internal-dev-cf98cfacafd7a77-1375784819.us-east-1.elb.amazonaws.com}]
	if len(hostnames) == 0 {
		log.Errorf("No ALB hostnames for ingress", *albIngress.id)
		return nil
	}

	log.Infof("%d %s", *albIngress.id, len(hostnames), hostnames[0].Hostname)
	return hostnames
}

@bigkraig
Copy link
Contributor

@aledbf yeah using that. the function is pretty simple so i am not seeing how this is breaking yet, but something is definitely off. it have gone unnoticed before since i think newIPs was probably always the same.

This is the func I am adding

+// UpdateIngressStatus tracks the ALB hostnames in the ingresses
+func (ac *ALBController) UpdateIngressStatus(ingress *extensions.Ingress) []api.LoadBalancerIngress {
+       albIngress := NewALBIngress(ingress.ObjectMeta.Namespace, ingress.ObjectMeta.Name, *ac.ClusterName)
+
+       i := ac.ALBIngresses.find(albIngress)
+       if i < 0 {
+               log.Errorf("Unable to find ingress", *albIngress.id)
+               return nil
+       }
+
+       var hostnames []api.LoadBalancerIngress
+       for _, lb := range ac.ALBIngresses[i].LoadBalancers {
+               if lb.CurrentLoadBalancer == nil || lb.CurrentLoadBalancer.DNSName == nil {
+                       continue
+               }
+               hostnames = append(hostnames, api.LoadBalancerIngress{Hostname: *lb.CurrentLoadBalancer.DNSName})
+       }
+
+       if len(hostnames) == 0 {
+               log.Errorf("No ALB hostnames for ingress", *albIngress.id)
+               return nil
+       }
+
+       log.Infof("%d %s", *albIngress.id, len(hostnames), hostnames[0].Hostname)
+       return hostnames
+}

@bigkraig
Copy link
Contributor

@aledbf yeah, the problem is here. We lose the original newIPs the first time UpdateIngressStatus is successful.

https://github.com/aledbf/ingress/blob/addcc4639f4024dc7f4ab7124f9744d97a5412a9/core/pkg/ingress/status/status.go#L307

@aledbf
Copy link
Member Author

aledbf commented Jul 19, 2017

@bigkraig I am waiting for #994 to fix and merge this PR

@bigkraig
Copy link
Contributor

ping @aledbf any chance we can knock this one out?

@aledbf
Copy link
Member Author

aledbf commented Jul 27, 2017

@bigkraig yes, at the end of the day I will update this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants