Description
Implement Kubernetes-based containerization in DevMux so that every user (or session) gets their own isolated container with a dedicated file structure. This ensures that code editing, execution, and file management are sandboxed per user, similar to how Gitpod or Codespaces work.
Expected Behavior
- A new Kubernetes Pod is created when a user starts a session.
- Each Pod has its own file system (via PVC or ephemeral volume).
- User’s code editor (Monaco/VS Code server) interacts directly with their container.
- Pods can be cleaned up automatically when sessions end or time out.
Current Behavior
Currently, all users share the same runtime environment, meaning:
- No per-user isolation.
- Possible file conflicts.
- Harder to scale or apply resource limits.
Steps to Reproduce (for bugs)
- Open DevMux with multiple users.
- Edit or run code simultaneously.
- Notice that the environment and file structure are shared across users.
Possible Solution
- Use Kubernetes Pods to launch a container per user/session.
- Mount per-user Persistent Volume Claims (PVCs) for file storage.
- Add TTL or cleanup jobs for terminating idle sessions.
- Implement a backend controller in DevMux to interact with the Kubernetes API (create/delete Pods).
- Proxy frontend connections to the correct container.
Additional Context
- Could leverage
codercom/code-server or a custom image with DevMux dependencies.
- Important for multi-user scalability, sandboxing, and security.
- Helps build towards a Gitpod-like environment within DevMux.
Contribution