Skip to content

[V2] Speed up sandbox startup with K3s tuning flags#7186

Closed
pingsutw wants to merge 3 commits intov2from
speed-up-sandbox-k3s-tuning
Closed

[V2] Speed up sandbox startup with K3s tuning flags#7186
pingsutw wants to merge 3 commits intov2from
speed-up-sandbox-k3s-tuning

Conversation

@pingsutw
Copy link
Copy Markdown
Member

@pingsutw pingsutw commented Apr 9, 2026

Summary

  • Add K3s tuning flags to make sandbox-run for faster pod startup:
    • --flannel-backend=host-gw — faster CNI setup (no VXLAN tunnel creation)
    • --kubelet-arg=node-status-update-frequency=2s — node marked Ready sooner
    • --kube-controller-manager-arg=node-monitor-period=2s — faster node monitoring
    • --disable=servicelb — disable unused service load balancer
  • Fix stale postmaster.pid preventing embedded-postgres from starting on container restart

Test plan

  • make sandbox-run starts successfully
  • All pods in flyte namespace reach Running state
  • Console accessible at http://localhost:30080/v2
  • Flyte API responds at http://localhost:30080/healthz
  • Stop and restart sandbox — postgres starts cleanly without PID file error
  • main
    • Flyte 2 #6583
      • [V2] Speed up sandbox startup with K3s tuning flags 👈

Optimize K3s startup in the sandbox by adding tuning flags:

- `--flannel-backend=host-gw`: Use host-gw instead of VXLAN overlay for
  faster CNI setup. In a single-node sandbox, host-gw adds static routes
  directly to the routing table instead of creating VXLAN tunnels.
- `--kubelet-arg=node-status-update-frequency=2s`: Reduce kubelet heartbeat
  interval from default 10s to 2s so the node is marked Ready faster.
- `--kube-controller-manager-arg=node-monitor-period=2s`: Reduce controller
  manager's node check interval from default 5s to 2s.
- `--disable=servicelb`: Disable the built-in service load balancer (unused).

Also fix a bug where embedded-postgres fails to start on container restart
due to a stale postmaster.pid file from unclean shutdown.

Signed-off-by: Kevin Su <pingsutw@apache.org>
@github-actions github-actions bot mentioned this pull request Apr 9, 2026
3 tasks
@pingsutw pingsutw marked this pull request as draft April 9, 2026 19:38
pingsutw added 2 commits April 9, 2026 13:32
Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
@pingsutw pingsutw closed this Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant