-
Notifications
You must be signed in to change notification settings - Fork 39k
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
AWS: service.alpha.kubernetes.io/external-traffic: OnlyLocal not working with ELB (a.k.a. "preserve source IP") #35187
Comments
Routing to local pods in the same AZ (when running multi-AZ cluster) is important on AWS also for cost efficiency (EC2 cross-AZ traffic costs 0.02 USD / GB): see the AWS Data Transfer Costs Overview Figure |
This isn't supposed to work in 1.4. we only put in the code that handles this for node port services in 1.5 ( ie head right now). The example I gave in 35758 should work, but note that that's just a simple node port service to keep your traffic local. does elb actually preserve src ip or do we need proxy protocol? |
This seems to work by now (Kubernetes 1.5.7). |
This just can't work on ELB |
@thockin |
@thockin |
I am using kubernetes 1.8.5 and I have the same issue. I use this service.
The endpoint is ok and the healthcheck port are change on kubernetes and on ELB. But the health check return there is no endpoint:
Even if the endpoint are ok
Do have any difference between endpoint and localendpoint ? |
I can confirm that I see the same behaviour as @sergeohl, difference is that I'm running: The previous beta spec The difference between 1.7 and 1.6 is that 1.7 will create a health check on the ELB pointing to another nodePort with HTTP:/healthz. That location is not created by kubernetes (as it should). In 1.6, k8s would drop traffic on nodes not running a pod for that nodePort. Hence the ELB would not send traffic to nodes that didn't have a pod running backing that service. On 1.6 the ELBs health check is pointing to the nodePort of the pod using TCP. Comparing output from same k8s service from 1.6 and 1.7, and also ELB output: 1.6
The OutOfService is expected since they are the 3x Infra Nodes in OpenShift. 1.7
If I change the healthcheck on the ELB created by kubernetes 1.7 like the following, it works as expected like it did in 1.6:
@thockin could you please consider reopening the issue based on this information? @sergeohl did you find a permanent workaround ? |
Is this a BUG REPORT or FEATURE REQUEST?: BUG REPORT
Kubernetes version: 1.4.0
Environment:
uname -a
): 4.7.0-coreosWhat happened:
Trying out the alpha "preserve source IP" feature (see #19754 and http://kubernetes.io/docs/user-guide/load-balancer/) which does not seem to work on AWS. The "local only" rule is not applied and traffic is still forwarded to all pods (i.e. to different nodes even across AZs).
What you expected to happen:
Iptables rules on nodes should route ELB traffic to local pods only if
OnlyLocal
is specified.How to reproduce it (as minimally and precisely as possible):
-feature-gates=AllAlpha=true
LoadBalancer
with the annotationservice.alpha.kubernetes.io/external-traffic: OnlyLocal
sudo iptables-save
): aKUBE-XLB-*
chain will be created, but no rule is using it (jumping to it with-j
).Anything else do we need to know:
This issue seems to be related to
aws.go
fillingLoadBalancerStatus.Ingress.Hostname
andproxier.go
expectingLoadBalancerStatus.Ingress.IP
. As the AWS ELB only provides a hostname (IPs change regularly), there is no easy fix.The text was updated successfully, but these errors were encountered: