-
Notifications
You must be signed in to change notification settings - Fork 150
[Bug] Discovery of k8s service when using AWS ELB #418
Comments
I've implemented a naive fix like this:
However this feels like the wrong approach as I'm overwriting/hiding the real name of the resource. We also can't use hostname since RDS targets do not have an option to use local/client resolver and will try to resolve hostnames in local cache (if I understood your code correctly). So it seems like the way forward is to do a resolution on the RDS server? (bearing in mind that AWS's ELB returns 2 public IPs). |
@networkop Thanks a lot for reporting this bug. You're right about this not being straightforward. There are a few possible approaches:
(2), and, to a certain extent (3), seem like the right approach. (2) will require more careful thought as it's changing the protobuf message. Let me give it a bit more thought and get back on this.
Are these IPv4 and IPv6? |
FYI, I am working on the client side changes to make this option work. So far this seems like a reasonable thing to do. |
great, thanks. there's just one concern I've got with this approach. Every load-balancer service will also have a unique
Of course, this implies changing the schema and much more code compared to option 3 🤷♂️ |
spec.ClusterIP is in fact the default IP you'll get. To get the ingress IP, you've to specify the ip_type as PUBLIC: cloudprober/rds/kubernetes/services.go Line 152 in c003b5c
Did I get your question correctly. |
ah yes, you're right, my apologies. |
… using system's DNS resolver. This is to support cases where resources have a hostname but not an IP, for example, AWS ELB: #418 PiperOrigin-RevId: 319832714
… using system's DNS resolver. This is to support cases where resources have a hostname but not an IP, for example, AWS ELB: #418 PiperOrigin-RevId: 319832714
…ame is not, RDS client has already been changed to DNS-resolve resource's IP if it's not a valid IP address. This is to support Kubernetes cases where ingress is given a hostname instead of an IP address, for example, AWS ELB. See #418 for more details. PiperOrigin-RevId: 320145826
Closing this. It will get released with v0.10.8: |
What happened: When using k8s service discovery in clusters running on AWS, discovery of public IP of LoadBalancer services fails
What you expected to happen: I am able to use AWS load-balancers as targets by all standard probes
How to reproduce it (as minimally and precisely as possible): create a k8s cluster with AWS as a cloud-provider. Create a LoadBalancer service and an RDS deployment that can discover it. Connect cloudprober to the RDS and attempt to probe it. The following is observed in the logs
Anything else we need to know?: this is caused by the fact that AWS ELB returns a hostname (cname/alias) instead of IP, which is what gets populated in a service's status field. Currently, RDS code assumes that
svc.Status.LoadBalancer.Ingress
can only contain an IP, whereas hostname is also a valid option and is what gets populated by the AWS cloud-provider code.The text was updated successfully, but these errors were encountered: