You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Service type LoadBalancer with externalTrafficPolicy: Local needs to work out of the box #212
As SCS container user, I need to be sure that deploying a standard nginx-ingress controller will create the needed L4 load-balancer that works without me having to tweak things with provider-dependent (infrastructure-specific) annotations.
Trouble currently is that various cloud-infras require tweaked deployment yamls to pass on custom annotations, e.g. to enable a health-monitor on OpenStack (with our current k8s-cluster-api-provider ref. implementation, because of the interaction between a NodePort-based load balancer and externalTrafficPolicy: Local as set by nginx ingress).
Definition of Ready:
User Story is small enough to be finished within one sprint
User Story is clear and understood by the whole team
Acceptance criteria are defined
Acceptance criteria are clear and understood by the whole team
Definition of Done:
ADR is written
Conformance test exists
SCS Reference implementation is tweaked such that it passed
changed the title [-]Servicetype: Loadbalancer needs to work out of the box[/-][+]Service type: Loadbalancer needs to work out of the box[/+]on Nov 7, 2022
changed the title [-]Service type: Loadbalancer needs to work out of the box[/-][+]Service type: LoadBalancer needs to work out of the box[/+]on Nov 7, 2022
changed the title [-]Service type: LoadBalancer needs to work out of the box[/-][+]Service type LoadBalancer needs to work out of the box[/+]on Nov 7, 2022
changed the title [-]Service type LoadBalancer needs to work out of the box[/-][+]Service type LoadBalancer with externalTrafficPolicy: Local needs to work out of the box[/+]on Nov 7, 2022
When you apply the wait condition for the test nginx pod we know that the pod is running and know that the error is coming from the loadbalancer.
I am not sure if you can use the kubectl wait for the loadbalancer service. Maybe worth a try
It looks like there was done some work but I did not check further yet:
Yes, explicitly checking whether the pod is running already would be a good idea; Ruling out this potential error source.
I am not sure if you can use the kubectl wait for the loadbalancer service. Maybe worth a try
It looks like there was done some work but I did not check further yet:
Ah, did not know that kubectl wait can handle non-condition fields now as well via jsonpath. Interesting.
But it does not enable querying more information. We'd still have to rely on .status.loadBalancer.ingress[0].ip.
In the testing setup, this is set earlier that traffic actually reaches the running pod. Another idea might be to look into K8s events, but I do not think that they are meant for automated use cases.
So, this is either a fixable bug in the current implementation, or we could adjust the script to handle the first non-successful requests as non-fatal and only consider the case as failed if (a) a testcase timeout occurs or (b) a request failed when a prior request succeeded.
@joshmue
I just checked the gridscale CCM implementation for the Loadbalancer.
Our internal cloud stack will only give us the IP if the loadbalancer is fully provisioned and ready to accept traffic. So the CCM actually gets the object in a useable state.
I could not find any spec yet from k8s. I think we just did this for our own sanity.
It make sense anyway to retrieve the IP for the loadbalancer only when the loadbalancer is ready. This might be a biased viewpoint though.
I guess we are forced to do a loop and/or time condition at this point for this test.
Activity
[-]Standardize requirement for working load-balancers[/-][+]Servicetype: Loadbalancer needs to work out of the box[/+][-]Servicetype: Loadbalancer needs to work out of the box[/-][+]Service type: Loadbalancer needs to work out of the box[/+][-]Service type: Loadbalancer needs to work out of the box[/-][+]Service type: LoadBalancer needs to work out of the box[/+][-]Service type: LoadBalancer needs to work out of the box[/-][+]Service type LoadBalancer needs to work out of the box[/+][-]Service type LoadBalancer needs to work out of the box[/-][+]Service type LoadBalancer with externalTrafficPolicy: Local needs to work out of the box[/+]joshmue commentedon Nov 8, 2022
Simple test scripts covering that:
With
externalTrafficPolicyset toCluster(default)With
externalTrafficPolicyset toLocalajfriesen commentedon Nov 14, 2022
@joshmue
There is
kubectl waitwhich might be handy here:https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#wait
When you apply the wait condition for the test nginx pod we know that the pod is running and know that the error is coming from the loadbalancer.
I am not sure if you can use the
kubectl waitfor the loadbalancer service. Maybe worth a tryIt looks like there was done some work but I did not check further yet:
joshmue commentedon Nov 14, 2022
Yes, explicitly checking whether the pod is running already would be a good idea; Ruling out this potential error source.
Ah, did not know that
kubectl waitcan handle non-condition fields now as well via jsonpath. Interesting.But it does not enable querying more information. We'd still have to rely on
.status.loadBalancer.ingress[0].ip.In the testing setup, this is set earlier that traffic actually reaches the running pod. Another idea might be to look into K8s events, but I do not think that they are meant for automated use cases.
So, this is either a fixable bug in the current implementation, or we could adjust the script to handle the first non-successful requests as non-fatal and only consider the case as failed if (a) a testcase timeout occurs or (b) a request failed when a prior request succeeded.
ajfriesen commentedon Nov 14, 2022
@joshmue
I just checked the gridscale CCM implementation for the Loadbalancer.
Our internal cloud stack will only give us the IP if the loadbalancer is fully provisioned and ready to accept traffic. So the CCM actually gets the object in a useable state.
I could not find any spec yet from k8s. I think we just did this for our own sanity.
It make sense anyway to retrieve the IP for the loadbalancer only when the loadbalancer is ready. This might be a biased viewpoint though.
I guess we are forced to do a loop and/or time condition at this point for this test.
garloff commentedon Nov 21, 2022
Decision:
We can't find rules that would mandate immediate availability after the LB reports being there.
Additionally look into CCM whether we can delay reporting LB service IP until LB is ACTIVE.
joshmue commentedon Dec 5, 2022
Upated simple test scripts:
With
externalTrafficPolicyset toCluster(default)With
externalTrafficPolicyset toLocalgarloff commentedon Dec 5, 2022
Test fails as it should against a loadbalancer on our Ref.Impl. unless we enable health-monitors by default, which is exactly what we expect.