aws / aws-cloud-map-mcs-controller-for-k8s

K8s controller implementing Multi-Cluster Services API based on AWS Cloud Map.
https://aws.amazon.com/blogs/opensource/kubernetes-multi-cluster-service-discovery-using-open-source-aws-cloud-map-mcs-controller/
Apache License 2.0
88 stars 28 forks source link

Utilising Endpoints instead of EndpointSlices #272

Open WJay-tec opened 1 year ago

WJay-tec commented 1 year ago

Based on my current observation and the problem encountered in this issue #270 , i realise the current implementation of the MCS controller obtains the EndpointSlices object instead of the Endpoints object when it comes to updating the cloud map with ip's of running pod.

This will cause issues related to RollingUpdate, as EndpointSlices is updated with newly created pod's ip even though the service have not passed its ReadinessProbe check. This should be mitigated if we instead take the info from Endpoints object instead, which only adds the pod's ip if it passes the readiness check.

runakash commented 1 year ago

Using EndpointSlice was a deliberate design choice to support large number of endpoints. And also is par with the Kubernetes's recommendation.

This will cause issues related to RollingUpdate, as EndpointSlices is updated with newly created pod's ip even though the service have not passed its ReadinessProbe check.

This is quite interesting. Is this documented behavior?

The Ready condition in EndpointSlice maps to Pod's ready.

WJay-tec commented 1 year ago

Ah i see, then is the code checking the condition before updating cloud map? From what i see the unready ip was already updated in all the clusters before the pod was up. I could be wrong @runakash