mirror of
https://github.com/sredevopsorg/deepseek-kubernetes-sandbox.git
synced 2026-11-03 01:13:24 +00:00
Fix DSH crash-loop after suspend/resume (fsGroup chmod) (#5)
Resuming a sandbox recreates its pod on the same PVC. The kubelet's default
fsGroup policy ("Always") recursively ORs 0660 into every file on each pod
start, so DSH's .credentials.yaml — created 0600 — comes back as 0660. The
credentials plugin refuses to boot in that case:
credentials-local: .../.credentials.yaml is readable beyond its owner
(mode 660); run "chmod 600 ..."
That makes the first resume after a suspend crash-loop, which breaks the
example's step 6 and any gateway wake-on-connect.
Set fsGroupChangePolicy: OnRootMismatch on both sandbox templates. The
kubelet then skips the recursive walk when the volume root already carries
the fsGroup ownership/mode applied on the first mount — exactly the
suspend/resume case, while a fresh PVC is still chowned correctly.
Document the upgrade path: Sandbox objects snapshot their pod template, so
existing sandboxes and warm-pool members need the policy patched (plus a
one-time chmod 600) or must be recreated.
Co-authored-by: SREDevOpsAgents <agents@sredevops.org>
This commit is contained in:
committed by
GitHub
parent
29eefd6ae5
commit
a8ef211aa4
@@ -140,6 +140,15 @@ sweeper skips everything else, so it can never suspend a sandbox an operator is
|
||||
that marker the sweeper would suspend a hand-applied claim 60s after first sighting and break
|
||||
`kubectl logs`/`port-forward` against its pod.
|
||||
|
||||
**Resume and file ownership.** The pod template sets `fsGroupChangePolicy: OnRootMismatch` on
|
||||
purpose. DSH's credentials plugin refuses to boot when `.credentials.yaml` has any group/other
|
||||
permission bit (it creates the file `0600`). The kubelet's default fsGroup policy (`Always`)
|
||||
recursively ORs `0660` into every file on each pod start, so the first resume of a sandbox would
|
||||
crash-loop with `mode 660`. `OnRootMismatch` only rewrites ownership/permissions when the volume
|
||||
root does not already match the fsGroup, which it does after the first mount — so suspend/resume
|
||||
keeps working. Sandboxes snapshot their pod template, so an updated `SandboxTemplate` does not
|
||||
retroactively change existing ones.
|
||||
|
||||
### WebSocket
|
||||
|
||||
```mermaid
|
||||
|
||||
Reference in New Issue
Block a user