How Tenkai keeps projects and environments apart
See how each environment of each project gets its own private network. Learn why containers on one server still share its kernel.
Updated
A developer runs a test script against staging. A few minutes later, real customers receive a test email, because staging had been writing into production all along. Keeping the two apart should not depend on everyone copying the right variable.
Each project starts with production, and you add environments such as staging. Tenkai gives each environment its own private application network in each cluster where it runs. Two projects never share one, even when they run on the same servers, so an application reaches only the databases of its own environment.
Scene 1 of 7: Servers in three places
These nodes run at Hetzner, DigitalOcean and home. They use public addresses here. Nodes on a shared private network can use private addresses instead.
One network per environment
An application joins the network of its environment and reaches the databases there by their runtime names. Traffic between nodes crosses the encrypted cluster network. You configure none of this: Tenkai creates a network once an environment has resources in a cluster, and removes it once unused.
Projects stay apart
A project groups environments, and each of them has its own network, so the separation between staging and production also holds between two projects. An application of one project cannot open a connection to a database of another project, even when both run on the same node. A cluster belongs to one team, so the servers of another team never run your containers.
Two networks reach across this boundary, and no application joins them as a way around it.
- Previews. The applications of a pull request preview also join the network of the database servers that the previews of their project share. Each preview logs in with a user that opens only its own database.
- External access to MySQL. The MySQL databases of a cluster share one more network, which only the external access relays join. Every login through it needs TLS and the password.
The edge router joins the networks whose applications it serves, with packet forwarding disabled, so it does not pass traffic from one network to another. It can still reach each of them, so their separation relies on the router staying trusted.
Network isolation, not system isolation
Environment networks decide who can open a connection to whom. They do not separate the containers themselves. Tenkai runs your applications and databases as ordinary Docker containers, started by runC, Docker's default runtime. Containers on one node share its Linux kernel and its disk. Namespaces give each container its own processes and files, and the size of each resource limits its CPU and memory.
Tenkai adds no sandbox such as gVisor or a virtual machine around a container. A kernel flaw or a container escape reaches the node, every container on it, and the cluster network. Treat all the projects of a cluster as one trust zone, and run code you do not trust on a separate cluster on separate servers.
Public addresses stay public
A staging application can still call production's public HTTPS address like any visitor, so authentication protects what network separation does not. Tenkai adds no per-port rules inside an environment network either, so a database still checks its password.
Copies have their own data
Create a database from a backup in another environment to inspect a copy without stopping production. The new database has its own credentials. Production writes made after the copy never reach it. A copy holds real customer data, so give access to it with the same care as production.