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

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

オープン
#3,274 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Java
スター
944
フォーク
242
平均マージ
1日 4時間
マージ済み PR(30日)
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. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

ソースファイルもテストも指定されていません。generationAwareEventProcessing を有効にし、metadata.generation が status.observedGeneration と等しい既存のカスタムリソースを使って、まず operator の起動を再現してください。起動時の reconciliation と informer-cache の処理を追跡します。変更されていないリソースが起動時に reconcile されず、このケースを対象とする regression test が追加されていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, kubernetes
領域
backend, infrastructure
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。