-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Fix e2e endpoints tests on Mesos #12410
Fix e2e endpoints tests on Mesos #12410
Conversation
Before this patch endpoints were validated by container IP and port. Depending on the endpoint controller logic neither of the two must match for a valid endpoint (e.g. in a Mesos setup). This patch checks that the endpoint targetRef points to the right pod by UID, instead of comparing IPs. A later patch will make sure the compared port is the actual container port, not the host port. /xref d2iq-archive/kubernetes-mesos#365
The EndpointPort struct only stores one port: the port which is used to connect to the container from outside. In the case of the Mesos endpoint controller this is the host port. The container port is not part of the endpoint structure at all. A number of e2e tests need the container port information to validate correct endpoint creation. Therefore this patch annotates the Endpoint struct with a number of annotations mapping "<HostIP>:<HostPort>" to "<ContainerPort>". In a follow-up commit these annotations are used to validate endpoints in a Mesos setup.
Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist") If this message is too spammy, please complain to ixdy. |
/cc @jdef for internal review |
|
||
// use endpoint annotations to recover the container port in a Mesos setup | ||
// compare contrib/mesos/pkg/service/endpoints_controller.syncService | ||
// TODO(sttts): add ContainerPort to EndpointPort struct, defaulting to (host) Port |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not sure about this TODO, doesn't really seem like the right way to solve this. perhaps remove the TODO here and add an issue for tracking this idea in the k8s-mesos repo?
minor doc nit, otherwise lgtm. /cc @thockin |
LGTM |
…ort-names Fix e2e endpoints tests on Mesos
Before this PR endpoints were validated by container IP and port in a number of e2e tests.
Depending on the endpoint controller logic neither of the two must match for a valid endpoint (e.g. in a Mesos setup).
This PR fixes the service.go e2e tests to compare the pod ID of an endpoint instead of the IP.
Moreover, it makes sure the compared port is the actual container port, not the host port.
The implemented solution for recovering the container ports from an endpoint in the case of Mesos clusters are annotations on the endpoints. These are applied by the Mesos endpoint conroller to be able to lookup the container port which is not part of the EndpointPort struct.