英文:
How to run CouchbaseBackupRestore only once
问题
我定义了一个用于我的Kubernetes集群的CouchbaseBackupRestore资源。通过Flux和Kustomize(GitOps)进行管理。
恢复操作进行得很顺利。但在完成后它会启动另一个恢复操作。
我希望它只运行一次。
是否可以告诉Kubernetes在第一个成功后不重新创建Pod?
当任务成功时,我必须注释掉我的Kustomize文件中的CouchbaseBackupRestore资源。
但这不是生产中可行的选项。
BackoffLimit也不是一个解决方案,因为如果失败,我希望它重试。
感谢您的帮助。
英文:
I define a CoucbaseBackupRestore resource for my kubernetes cluster. Managed with flux and kustomize (gitops)
The restore goes well. But when it is finished it starts another restore.
I want it to run only once.
Is it possible to tell kubernetes to not recreate a pod when the first one succeeds?
I have to comment out my CouchbaseBackupRestore resource in my kustomize file when the job succeeds.
But this is not a viable option for production.
BackoffLimit is not a solution either, as I want it to retry if it fails.
Thanks for tour help
答案1
得分: 1
目前,操作员将对成功还原的作业进行垃圾回收。期望的行为是仅在需要还原作业时应用还原YAML。
这会在这样的工作流中导致重复创建;但是,我们已经开了一张跟踪此请求的工单!https://issues.couchbase.com/browse/K8S-3121
英文:
Currently, the Operator will garbage collect successful restore jobs. The expected behaviour is that the restore yaml would only be applied when a restore job is required.
This causes repeat creation in workflows like this; however, we've opened a ticket to track this request! https://issues.couchbase.com/browse/K8S-3121
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论