使用主备部署将 karaf 从旧部署迁移到云

Migrating karaf from Legacy deployment to cloud with active-standby deployment

目前我们有像下面这样的 karaf 部署

根据当前的研究,现在我们计划迁移到 kubernetes

Kubernetes 将为我们创建 1 个 pod,我们将快乐状态声明为 1 意味着如果 POD 出现故障,它会自动启动新的,但我担心的是 启动新的 POD 将花费更多时间,因为在传统部署中,待机 处于半活跃状态。

我们如何在kubernetes中实现这样的主备?

答案由Tomislav Mikulin在评论中提供:

That depends on if you app is stateless or not...if its stateless that just use more then one pod (like 2 or 3) for your app, and you should be all set...

If you don't want (or can't) have multiple pods of you app already running, you could make two different deployments of the same app, and just switch them through the Service object. That way you could have an extra pod running that you can switch on at any moment.