EKS StartupProbe 上的 Kubernetes 1.18 和旧的 ServiceAccountName

Kubernetes 1.18 on EKS StartupProbe with old ServiceAccountName

我有一个部署,它在 EKS 上的 K8S 1.17 上运行良好。将 K8S 升级到 1.18 后,我尝试通过简单部署使用 startupProbe 特性。一切都按预期工作。但是当我尝试将 startupProbe 添加到我的生产部署时,它不起作用。集群在创建 pods 时简单地删除 startupProbe 条目(尽管 startupProbe 条目存在于集群上的部署对象定义中)。有趣的是,当我在部署清单中将 serviceAccountName 条目更改为 default(而不是我的应用程序服务帐户)时,一切都按预期进行。 那么现在的问题是,为什么现有的服务账号不能有启动探测呢? 谢谢。

将此作为社区成员的回答发布。随意展开。

问题

startupProbe is not applied to Pod if serviceAccountName is set

When adding serviceAccountName and startupProbeto the pod template in my deployment, the resulting pods will not have a startup probe.

关于那个 github issue

解决方案

这个问题正在解决here,目前它仍然开放,没有具体的答案。

如@mcristina422所述

I think this is due to the old version of k8s.io/api being used in the webhook. The API for the startup probe was added more recently. Updating the k8s packages should fix this