Cluster autoscaler probably cannot drain nodes running Tapas pods

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

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

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

評価

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

調査の方向性

Start with internal/executor/kube/layout.go:22-27 and trace pod creation in internal/executor/kube/render.go:23, plus the emptyDir definitions in internal/pixienv/pixienv.go:266, internal/podfiles/podfiles.go:72, and internal/controller/jobs/build.go:245. Compare the generated pod volumes and annotations with the cluster autoscaler's FAQ, then verify the behavior on an autoscaled node with an app pod and a job pod. Done means the observed eviction behavior is documented and the annotation behavior or intended policy is resolved.

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

説明

needs: investigation 🔍 type: bug 🐛

Tapas marks app, run and file pods with cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes: scratch,tmp (internal/executor/kube/layout.go:22-27), so the cluster autoscaler can drain a node whose only local data is scratch space. Reading the code against the autoscaler's FAQ, I don't think the annotation can have that effect for any of our pods.

App and file pods are bare pods. Render creates a corev1.Pod with no owner (internal/executor/kube/render.go:23). The FAQ ("What types of pods can prevent CA from removing a node?") lists "Pods that are not backed by a controller object" as blocking scale-down, unless the pod has cluster-autoscaler.kubernetes.io/safe-to-evict: "true". The local-volumes annotation doesn't lift that.

Job pods have unlisted emptyDirs. Job pods do have a controller, so the local-storage rule applies to them. The FAQ says the annotation only helps when "all of the pod's local volumes are listed in the annotation value", and it counts every emptyDir that isn't medium: Memory. Our pods carry several besides scratch and tmp, for example:

  • javo-env (internal/pixienv/pixienv.go:266);
  • the pod-files volumes (internal/podfiles/podfiles.go:72);
  • the runner volume for jobs (internal/controller/jobs/build.go:245).

What I haven't checked: I haven't drained a node with the autoscaler, and the FAQ doesn't spell out what happens when one local volume is missing from the list. To check, run an app and a job on a node of an autoscaled group (autoscaler defaults, which per the FAQ's parameter table include --skip-nodes-with-local-storage=true), leave the node otherwise idle, and see whether the autoscaler removes it or logs the pod as blocking.

If it holds, we need to decide what we want:

  • App pods: is it safe to evict a running app? Evicting stops the person's session; the home survives. If yes, set safe-to-evict: "true". If no, the current behaviour is right and the local-volumes annotation is dead code.
  • Job pods: list every emptyDir in the annotation, built from the pod's volumes instead of a fixed string.

Found while writing the pixi mirror spec (#25), which adds one more emptyDir (envs) to the list.

主要言語
Go
スター
5
フォーク
0
平均マージ
21時間 13分
マージ済み PR(30日)
53

環境構築

はじめの一歩

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

nebari-dev/tapas のほかの issue

nebari-dev/tapas の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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