Cluster autoscaler probably cannot drain nodes running Tapas pods

Abierto
#52 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
46/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go, kubernetes

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Go
Estrellas
5
Forks
0
Merge medio
21 h 13 min
PR fusionados (30 d)
53

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nebari-dev/tapas

Todos los issues de nebari-dev/tapas

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.