Containers without a resources section run with no CPU or memory limit

未關閉
#301 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
35/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
docker, go, typescript

研究方向

Start with apps/api/src/modules/deployments/domain/container-plan.ts and agent/internal/actions/container_spec.go to trace how resource values reach Docker and placement. Read SPEC and the tests covering deployment plans and containers; the issue calls for a decision on default limits versus mandatory declarations before implementation. Done means containers always have CPU and memory limits, placement reserves those same values, SPEC documents the defaults, and a test covers an application without resources.

由索引模型根據 Issue 內容生成。

描述

needs-decision

What

An application without a resources section gets no CPU or memory limit. The deployment plan produces cpuMillis: 0 and memoryBytes: 0 (apps/api/src/modules/deployments/domain/container-plan.ts), the agent passes them to Docker as "no limit" (agent/internal/actions/container_spec.go), and placement reserves nothing for it.

One application can then starve the others on the same server, by accident or on purpose. The process limit and log rotation do not cover CPU and memory.

Found by a security audit of the repository on 8 November 2026, still true on main.

Decision needed

  • Default limits for an application that declares none. Suggested: 1 CPU and 512 MiB, overridable in shipkeep.yml.
  • Whether declaring resources becomes mandatory instead.
  • Later: quotas per environment, and capacity kept back for the node's own services (agent, Caddy, Docker).

Done when

  • A container is never created without a CPU and a memory limit.
  • Placement reserves the same values it enforces.
  • SPEC states the defaults, and a test covers an application without resources.
主要語言
TypeScript
星號
2
分支
1
平均合併
7 小時 17 分鐘
30 天內合併 PR
197

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

shipkeepdev/shipkeep 的其他 Issue

查看 shipkeepdev/shipkeep 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。