Kubernetes 如何等待X秒完成k8s中的滚动更新?

Kubernetes 如何等待X秒完成k8s中的滚动更新?,kubernetes,rolling-updates,Kubernetes,Rolling Updates,我正在使用k8s部署我的docker应用程序 一旦应用程序被声明需要20-30秒才能准备好,应用程序是巨大的,启动时需要一些时间 引导平均时间为20-30秒。我想在滚动更新期间等待60秒。因为现在,旧pod在启动新应用程序时被终止(在新pod中) 如何操作?在pod规范中配置一个足够长的FailureReshold*periodSeconds来覆盖最坏情况下的启动时间。例如 ports: - name: readiness-port containerPort: 8080 hostPor

我正在使用k8s部署我的docker应用程序

一旦应用程序被声明需要20-30秒才能准备好,应用程序是巨大的,启动时需要一些时间

引导平均时间为20-30秒。我想在滚动更新期间等待60秒。因为现在,旧pod在启动新应用程序时被终止(在新pod中)

如何操作?

在pod规范中配置一个足够长的
FailureReshold*periodSeconds
来覆盖最坏情况下的启动时间。例如

ports:
- name: readiness-port
  containerPort: 8080
  hostPort: 8080

readinessProbe:
  httpGet:
    path: /healthz
    port: readiness-port
  failureThreshold: 1
  periodSeconds: 10

startupProbe:
  httpGet:
    path: /healthz
    port: readiness-port
  failureThreshold: 30
  periodSeconds: 10

你准备好你的吊舱了吗?在新吊舱准备好(探针通过)之前,旧吊舱不应该被拆掉。好的。所以,
/healthz
是我的应用程序的某个端点,当响应代码为200时,它每10秒调用一次(30秒后会失败),这是我的应用程序准备就绪的k8s信号吗?