memory-bank/components/ws-manager-mk2.md
The Workspace Manager MK2 (ws-manager-mk2) is a Kubernetes controller responsible for managing the lifecycle of workspaces in Gitpod. It orchestrates the creation, monitoring, and deletion of workspace pods and related resources in the Kubernetes cluster.
The primary purposes of the Workspace Manager MK2 are:
Workspace Manager MK2 is implemented as a Kubernetes controller using the controller-runtime framework. It consists of several key components:
The component follows the Kubernetes operator pattern, watching for changes to Workspace custom resources and reconciling the actual state with the desired state.
main.go: Entry point that sets up the controller manager and gRPC servicecmd/: Command-line interface implementationcontrollers/: Kubernetes controllers for workspace resourcesservice/: gRPC service implementationpkg/: Supporting packages and utilitiesconfig/: Configuration files, including CRD definitionscomponents/common-go:lib: Common Go utilitiescomponents/content-service-api/go:lib: Content service API definitionscomponents/content-service:lib: Content service clientcomponents/registry-facade-api/go:lib: Registry facade API definitionscomponents/ws-manager-api/go:lib: Workspace manager API definitionscomponents/image-builder-api/go:lib: Image builder API definitionsWorkspace Manager MK2 is configured via a JSON configuration file that includes:
Workspace Manager MK2 integrates with:
Workspace Manager MK2 is typically used to:
The component exposes Prometheus metrics for: