You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/12/14 03:02:42 UTC

[GitHub] [apisix] zhixiongdu027 commented on issue #8489: bug: 使用k8s服务发现功能,出现偶发pod ip不更新情况导致请求到已关闭的pod ip

zhixiongdu027 commented on issue #8489:
URL: https://github.com/apache/apisix/issues/8489#issuecomment-1350312166

   
   > 只是当大量deployment同时滚动时,会出现apisix无法更新pod ip情况,最后导致请求到旧的pod ip上
   
   kubernetes 从 “endpoinst 摘除旧 pod ip” 和 “删除 旧 pod ” 是并行的.
   如果  "删除 旧 pod " 先执行完毕,  “endpoinst 摘除旧 pod ip” 后执行完, 那问题就不可避免了.
   这里的最佳实践是  定制  pod 的  preStop , 并且在  “preStop” 中 "sleep" 一段时间 .
   
   
   
   
   
   如果你怀疑是延迟导致的问题, 那么问题中应该涉及到 三个方面的延迟
   
   + pod 的变动反应到 endpoints 中的延迟
   + endpoints 的变动 到 kubernetes discovery 接收到 events 的延迟
   + kubernetes discovery 接收到 events 后,修改 nodes 列表的延迟
   
   为了验证,我们可以做如下试验:
   
   1.  将 apisix 日志级别改为 debug
   2.  模拟 滚动 deployment 
   3.  对比 kubernetes discovery 的日志打印时间和日志内容里面的更改时间,两个时间差值可以反应出延迟情况
   
   
   
   @chenjinxuan @tzssangglass 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org