您为什么不应该在Composer上运行Kubernetes Pod超过一个小时呢? [英] Why shouldn't you run Kubernetes pods for longer than an hour from Composer?

查看:89
本文介绍了您为什么不应该在Composer上运行Kubernetes Pod超过一个小时呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Cloud Composer文档明确指出:

由于Kubernetes Python客户端库出现问题,因此您的Kubernetes Pod应该设计为运行不超过一个小时.

Due to an issue with the Kubernetes Python client library, your Kubernetes pods should be designed to take no more than an hour to run.

但是,它没有提供更多的上下文信息,而且我在Kubernetes Python客户端项目上找不到明确相关的问题.

However, it doesn't provide any more context than that, and I can't find a definitively relevant issue on the Kubernetes Python client project.

为了测试它,我跑了一个豆荚两个小时,没有发现任何问题.哪个问题造成了此限制,它如何体现?

To test it, I ran a pod for two hours and saw no problems. What issue creates this restriction, and how does it manifest?

推荐答案

我对Cloud Composer或Kubernetes Python客户端库生态系统并不十分熟悉,但是按大多数评论对GitHub问题跟踪器进行排序显示,该开放项目靠近列表顶部: https://github.com/kubernetes-client/python/issues /492

I'm not deeply familiar with either the Cloud Composer or Kubernetes Python client library ecosystems, but sorting the GitHub issue tracker by most comments shows this open item near the top of the list: https://github.com/kubernetes-client/python/issues/492

听起来好像存在令牌过期问题:

It sounds like there is a token expiration issue:

@yliaog这对我们来说是个问题,因为我们将kubernetes pod运行为 批处理并使用静态跟踪容器的状态 客户.客户端对象初始化之后,就不会刷新,并且 因此,任何超过60分钟的工作都会失败.看着 通过python-base,似乎我们可以制作一个包装类, 每n分钟生成一个新客户端(或刷新配置),或者 在每次通话前检查状态(如@mvle所示).最好的解决方法 将使用swagger-codegen,但是临时解决方案可能 对很多人来说非常有用.

@yliaog this is an issue for us, as we are running kubernetes pods as batch processes and tracking the state of the pods with a static client. Once the client object is initialized, it does no refresh, and therefore any job that takes longer than 60 minutes will fail. Looking through python-base, it seems like we could make a wrapper class that generates a new client (or refreshes the config) every n minutes, or checks status prior to every call (as @mvle suggested). The best fix would be in swagger-codegen, but a temporary solution would probably be very useful for a lot of people.

-@flylo, https://github.com/kubernetes -client/python/issues/492#issuecomment-376581140

这篇关于您为什么不应该在Composer上运行Kubernetes Pod超过一个小时呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆