When using CODER_MEMORY, OOM kills don't terminate the outer container.
- Lingua principale
- Go
- Stelle
- 73
- Fork
- 22
- Merge medio
- 9h 44m
- PR unite (30g)
- 2
Descrizione
While testing these out, I noticed this behavioral difference.
* With a traditional pod, if the workspace tries to allocate memory beyond its limit, the pod gets OOM killed, freeing the pod's resources.
* With an envbox pod, if not using CODER_MEMORY, processes running in the inner pod aren't restricted by the pod's limits; the pod is OOM killed if it tries to allocate more memory than is available on the node.
* If using CODER_MEMORY, excessive allocation kills the inner pod, but `/envbox docker` keeps running and so the pod keeps running & reserving resources, even as the workload we actually cared about is dead.
The template I'm using is based on https://github.com/coder/coder/blob/main/examples/templates/kubernetes-envbox/main.tf ; the relevant portion of the pod definition looks like this:
```
container {
name = "dev"
image = local.envbox_image
command = ["/envbox", "docker"]
env {
name = "CODER_MEMORY"
value_from {
resource_field_ref {
resource = "limits.memory"
}
}
}
```
Possibly there is something I ought to tweak so that /envbox terminates when the inner pod does? I'm not sure if I've missed something there.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Start with examples/templates/kubernetes-envbox/main.tf and trace the /envbox docker entry point where CODER_MEMORY is handled. Reproduce an inner-pod OOM and observe the outer container; done means the outer /envbox process and pod terminate when the inner workload is killed.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- docker, go, kubernetes
- Ambito
- devops, infrastructure
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100