operator-framework / operator-framework/java-operator-sdk

Reconciler with enabled "generationAwareEventProcessing" reconciles unchanged custom resource upon startup

未关闭
#3,274 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Java
星标
944
派生
242
平均合并
1 天 4 小时
30 天内合并 PR
43

描述

Bug Report

What did you do?

Hello,

We've encountered the behavior where we're using the default Reconciler settings, which has generationAwareEventProcessing turned on as well as a default maxReconciliationInterval set to 10 hours. Our CR implements the ObservedGenerationAwareStatus interface, so it has the observedGeneration property present in the status and it's handled by the framework.

We're seeing that upon Operator startup a reconciliation is triggered, when there is an already created custom resource in the cluster which has been reconciled already and has metadata.generation equal to status.observedGenertion.

The problem in this scenario is that the Operator is being updated and has updated logic, triggered by a pipeline automation script update. An update to the CR is going to follow in the next pipeline step. However, the triggered reconciliation captures the current CR in the cluster before the updated one can be applied. That in some cases leads to breaking dependent resources spec and subsequent failure (e.g. old incompatible images read from the CR set to an updated Deployment dependent resources spec encoded in the Operator code).

What did you expect to see?

No reconciliation triggered on the CR, which has it's generation and observed generation matching properties.

Environment

Kubernetes cluster type:

Gardener K8s 1.33.5

java-operator-sdk version is 4.4.4

Java version 17

Possible Solution

Not sure if the behavior could be caused by the maxReconciliationInterval being not set after the update or just informer caches being empty.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

未指定源文件或测试。首先使用启用 generationAwareEventProcessing 的 operator,以及一个 metadata.generation 等于 status.observedGeneration 的现有自定义资源,复现 operator 启动;跟踪启动时的 reconciliation 和 informer-cache 处理。完成标准是:未发生变化的资源在启动时不会被 reconcile,并且有一个回归测试覆盖此情况。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, kubernetes
领域
backend, infrastructure
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。