Skip to content

docs: update architecture & diagram #4721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 26 additions & 30 deletions docs/about/architecture.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
# Architecture

## Agents

An agent is the Coder service that runs within a user's remote workspace.
It provides a consistent interface for coderd and clients to communicate
with workspaces regardless of operating system, architecture, or cloud.

It offers the following services along with much more:

- SSH
- Port forwarding
- Liveness checks
- `startup_script` automation
This document provides a high level overview of Coder's architecture.

## Service Bundling
## Diagram

While coderd, provisionerd and Postgres can be orchestrated independently,
our default installation paths bundle them all together into one system service.
It's perfectly fine to run a production deployment this way, but there are
certain situations that necessitate decomposition:

- Reducing global client latency (distribute coderd and centralize database)
- Running untrusted provisioners (separate provisionerd from nodes with DB access)
- Achieving greater availability and efficiency (horizontally scale individual services)
![Architecture Diagram](../images/architecture-diagram.png)

## coderd

Expand All @@ -43,16 +25,30 @@ It offers:
provisionerd is the execution context for infrastructure modifying providers.
At the moment, the only provider is Terraform (running `terraform`).

Since the provisionerd can be separated from coderd, it can run the provider
in a myriad of ways on the same Coder deployment. For example, provisioners
can have different `terraform` versions to satisfy the requirements of different
templates.
> At the moment, provisionerd cannot be separated from coderd. Follow [this GitHub issue](https://github.com/coder/coder/issues/44) for more details.

## Agents

Separability is also advantageous for security. Since provisionerd has no
database access, infrastructure admins that are not necessarily Coder admins
can be safely given access to the provisionerd node. As Coder scales and
multiple infrastructure teams appear, each can be given access to their own
set of provisionerd nodes, with each set of nodes having their own cloud credentials.
An agent is the Coder service that runs within a user's remote workspace.
It provides a consistent interface for coderd and clients to communicate
with workspaces regardless of operating system, architecture, or cloud.

It offers the following services along with much more:

- SSH
- Port forwarding
- Liveness checks
- `startup_script` automation

Templates are responsible for [creating and running agents](../templates.md#coder-agent) within workspaces.

## Service Bundling

While coderd and Postgres can be orchestrated independently,our default installation
paths bundle them all together into one system service. It's perfectly fine to run a production deployment this way, but there are certain situations that necessitate decomposition:

- Reducing global client latency (distribute coderd and centralize database)
- Achieving greater availability and efficiency (horizontally scale individual services)

## Workspaces

Expand Down
Binary file added docs/images/architecture-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.