Kubernetes reference chart: an operator command can leave an unowned NetworkPolicy when the policy create times out

オープン 初心者向け
#2,761 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
kubernetes, python

調査の方向性

deploy/stack_operator.py の Installation.job() から始め、NetworkPolicy の作成、Job の作成、active_job の割り当ての順序を追ってください。次に、失敗時に Lease を解放する経路を見つけてください。ジョブ作成まわりの既存の operator テストを探して、kubectl 呼び出しがどのようにスタブされているかを確認してください。失敗するポリシーのケースが必要になるからです。修正は、Lease を解放する前に kubectl delete networkpolicy --ignore-not-found を試すか、Lease を保持してどのオブジェクトを確認すべきかを報告するかのどちらかです。つまり、完了とは、不確実な作成経路が所有者のないポリシーを残さず、失敗が報告されることを意味します。

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

説明

Installation.job() in deploy/stack_operator.py creates an operation Job's NetworkPolicy before it sets active_job. If kubectl create for the policy fails with an uncertain outcome, such as a server timeout or a lost connection, the operator releases its Lease. The policy may still exist.

That policy has no owner reference yet, because the owner is set to the Job only after the Job is created, and it has no TTL. So it stays until someone deletes it by hand.

Impact: low. The policy selects only the unique registrystack.org/operation-id label of an operation that never ran, so it affects no other workload. It is clutter, and it is left over after an operator command that did not report it.

Possible fixes:

  • On a failed policy create, try once to kubectl delete networkpolicy <name> --ignore-not-found before releasing the Lease, and report if that delete also fails.
  • Or treat an uncertain policy create like an uncertain Job create: keep the Lease and tell the operator which object to check.

Found during the review of #2758. It is older than #2758 and was left out of that PR.

主要言語
Rust
スター
2
フォーク
0
平均マージ
9時間 48分
マージ済み PR(30日)
151

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

registrystack/registry-stack のほかの issue

registrystack/registry-stack の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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