Architecture

This document describes the architecture of CoCalc in Kubernetes. It’s helpful to know a bit about the services it is composed of, but it’s not necessary to understand everything in every detail.

Here is a high-level overview:

  • Database: holds all the information about users, projects, and everything else.

  • Storage: holds all files edited and published by users via their projects.

  • Hub services: the entry points for users and projects from the internet. They are responsible for authentication, authorization, and routing.

  • Project pods: the actual containers running the user projects. These project pods are managed by a set of microservices called

  • Manage, which are responsible for starting, stopping, and monitoring projects.

In a nutshell, this is what they’re doing:

  • A couple of services will be running in pods in the kubernetes cluster → Hubs, Static and Manage,

  • Some of them will talk to the database → Database,

  • Some have endpoints, which are exposed via Ingress configuration files → Static and Hubs,

  • A few services will dynamically create and delete pods (aka “CoCalc Projects”) inside that cluster → Manage,

  • and many of these pods will mount directories of a shared filesystem → Storage.

After you have a basic understanding of the architecture, you can continue preparing your cluster.