Skip to content

Commit e5ab05c

Browse files
author
Gabriel Monroy
committed
Merge pull request #2450 from gabrtv/understanding-deis
docs(understanding_deis): refactor architecture, concepts, components
2 parents 50e0cd2 + cbc8bf4 commit e5ab05c

9 files changed

Lines changed: 185 additions & 118 deletions
-200 KB
Binary file not shown.
137 KB
Loading
126 KB
Loading
186 KB
Loading
184 KB
Loading

docs/understanding_deis/architecture.rst

Lines changed: 47 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -6,103 +6,70 @@
66
Architecture
77
============
88

9-
.. image:: DeisArchitecturalDiagram.png
10-
:alt: Draft Architectural Diagram
9+
Deis uses a service oriented architecture with :ref:`components`
10+
grouped into a Control Plane, Data Plane and Router Mesh.
1111

12-
.. TODO: Need a caption for the Deis architectural diagram
12+
.. _system-diagram:
1313

14-
Deis consists of 7 components that combine to create a distributed PaaS.
15-
Each Deis component is deployed as a :ref:`Container`.
14+
System Diagram
15+
--------------
1616

17-
.. _arch_controller:
17+
.. image:: DeisSystemDiagram.png
18+
:alt: Deis System Diagram
1819

19-
Controller
20-
----------
21-
The :ref:`controller <Controller>` component is a RESTful API server
22-
written with `Django`_ and `Celery`_. Command-line clients interact with
23-
this component.
20+
End-users of the platform interact with the Control Plane using the ``Deis API``.
21+
Operators use the ``Deisctl API`` to stand up the cluster's Control Plane, Data Plane
22+
and Router Mesh.
23+
24+
The Control Plane dispatches work to the Data Plane via a scheduler.
25+
The Router Mesh is used to route traffic to both the Control Plane and Data Plane.
26+
Because the router mesh is usually connected to the public Internet,
27+
it is often connected to a front-end load balancer.
2428

25-
.. _database:
29+
.. _control-plane:
2630

27-
Database
28-
--------
29-
The database component is a `PostgreSQL`_ server used to store durable
30-
platform state. Backups and WAL logs are pushed to :ref:`Store`.
31+
Control Plane
32+
-------------
3133

32-
.. _cache:
34+
.. image:: DeisControlPlane.png
35+
:alt: Deis Control Plane Architecture
3336

34-
Cache
35-
-----
36-
The cache component uses `Redis`_ to:
37+
The Control Plane performs management functions for the platform.
38+
Control plane components (in blue) are all implemented as Docker containers.
3739

38-
* Store work queue data for `Celery`_
39-
* Cache sessions and synchronize locks for `Django`_
40-
* Store recent log data for the :ref:`Controller`
40+
The :ref:`store` component consists of a number of smaller components that represent a
41+
containerized Ceph cluster which provides a blob storage API and POSIX filesystem API
42+
for control plane's stateful components:
4143

42-
.. _builder:
44+
* :ref:`registry` - a Docker registry used to hold images and configuration data
45+
* :ref:`database` - a Postgres database used to store platform state
46+
* :ref:`logger` - a syslog log server that holds aggregated logs from the data plane
4347

44-
Builder
45-
-------
46-
The builder component uses a `Git`_ server to process
47-
:ref:`Application` builds. The builder:
48+
End-users interact primarily with the :ref:`comp_controller` which exposes an
49+
HTTP API. They can also interact with the :ref:`builder` via ``git push``.
4850

49-
#. Receives incoming ``git push`` requests over SSH
50-
#. Authenticates the user via SSH key fingerprint
51-
#. Authorizes the user's access to write to the Git repository
52-
#. Builds a new `Docker` image from the updated git repository
53-
#. Adds the latest :ref:`Config` to the resulting Docker image
54-
#. Pushes the new Docker image to the platform's :ref:`Registry`
55-
#. Creates a new :ref:`Release` on the :ref:`Controller`
51+
.. _data-plane:
5652

57-
Once a new :ref:`Release` is generated, a new set of containers
58-
is deployed across the platform automatically.
53+
Data Plane
54+
----------
5955

60-
.. _registry:
56+
.. image:: DeisDataPlane.png
57+
:alt: Deis Data Plane Architecture
6158

62-
Registry
63-
--------
64-
The registry component hosts `Docker`_ images on behalf of the platform.
65-
Image data is stored by :ref:`Store`.
59+
The Data Plane is where :ref:`Containers <container>` (in blue) are run on behalf of end-users.
6660

67-
.. _logspout:
61+
The platform scheduler is charge of placing containers on hosts in the data plane.
62+
Deis also requires a few lightweight components on these hosts:
6863

69-
Logspout
70-
--------
71-
The logspout component is a customized version of `progrium's logspout`_ that runs
72-
on all CoreOS hosts in the cluster and collects logs from running containers. It sends the logs
73-
to the :ref:`logger` component.
64+
* :ref:`publisher` - publishes end-user containers to the :ref:`router`
65+
* :ref:`logspout` - feeds log data to the Control Plane :ref:`logger`
7466

75-
.. _logger:
67+
.. _topologies:
7668

77-
Log Server
69+
Topologies
7870
----------
79-
The log server component collects logs from the :ref:`logspout` component.
80-
This data can then be queried by the :ref:`Controller`.
81-
82-
.. _router:
83-
84-
Router
85-
------
86-
The router component uses `Nginx`_ to route traffic to
87-
application containers.
88-
89-
.. _store:
90-
91-
Store
92-
------
93-
The store component uses `Ceph`_ to store data for Deis components
94-
which need to store state (namely :ref:`Registry` and :ref:`Database`).
95-
96-
.. _`Amazon S3`: http://aws.amazon.com/s3/
97-
.. _`Celery`: http://www.celeryproject.org/
98-
.. _`Ceph`: http://ceph.com
99-
.. _`Django`: https://www.djangoproject.com/
100-
.. _`Docker`: http://docker.io/
101-
.. _`etcd`: https://github.com/coreos/etcd
102-
.. _`Git`: http://git-scm.com/
103-
.. _`Nginx`: http://nginx.org/
104-
.. _`OpenStack Storage`: http://www.openstack.org/software/openstack-storage/
105-
.. _`PostgreSQL`: http://www.postgresql.org/
106-
.. _`progrium's logspout`: https://github.com/progrium/logspout
107-
.. _`Redis`: http://redis.io/
108-
.. _`rsyslog`: http://www.rsyslog.com/
71+
72+
For small deployments you can run the entire platform
73+
-- Control Plane, Data Plane and Router Mesh -- on just 3 servers.
74+
For larger deployments, you'll want to isolate the Control Plane and Router Mesh,
75+
then scale your data plane out to as many servers as you need.
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
:title: Components
2+
:description: Components of the Deis application platform (PaaS)
3+
4+
.. _components:
5+
6+
Components
7+
==========
8+
9+
Deis consists of a number of components that combine to create a distributed PaaS.
10+
Each Deis component is deployed as a container or set of containers.
11+
12+
.. _comp_controller:
13+
14+
Controller
15+
----------
16+
The controller component is an HTTP API server.
17+
The ``deis`` command-line client interacts with this component.
18+
19+
.. _database:
20+
21+
Database
22+
--------
23+
The database component is a `PostgreSQL`_ server used to store durable
24+
platform state. Backups and WAL logs are pushed to :ref:`Store`.
25+
26+
.. _cache:
27+
28+
Cache
29+
-----
30+
The cache is an instance of `Redis`_ used by the controller
31+
and registry.
32+
33+
.. _builder:
34+
35+
Builder
36+
-------
37+
The builder component uses a `Git`_ server to process
38+
:ref:`Application` builds. The builder:
39+
40+
#. Receives incoming ``git push`` requests over SSH
41+
#. Authenticates the user via SSH key fingerprint
42+
#. Authorizes the user's access to write to the Git repository
43+
#. Builds a new `Docker` image from the updated git repository
44+
#. Adds the latest :ref:`Config` to the resulting Docker image
45+
#. Pushes the new Docker image to the platform's :ref:`Registry`
46+
#. Creates a new :ref:`Release` on the :ref:`Controller`
47+
48+
Once a new :ref:`Release` is generated, a new set of containers
49+
is deployed across the platform automatically.
50+
51+
.. _registry:
52+
53+
Registry
54+
--------
55+
The registry component hosts `Docker`_ images on behalf of the platform.
56+
Image data is stored by :ref:`Store`.
57+
58+
.. _logspout:
59+
60+
Logspout
61+
--------
62+
The logspout component is a customized version of `progrium's logspout`_ that runs
63+
on all CoreOS hosts in the cluster and collects logs from running containers.
64+
It sends the logs to the :ref:`logger` component.
65+
66+
.. _logger:
67+
68+
Logger
69+
------
70+
The logger component is a syslog server that collects logs from :ref:`logspout`
71+
components spread across the platform.
72+
This data can then be queried by the :ref:`Controller`.
73+
74+
.. _publisher:
75+
76+
Publisher
77+
---------
78+
The publisher component is a microservice written in Go that publishes
79+
containers to etcd so they can be exposed by the platform :ref:`router`.
80+
81+
.. _router:
82+
83+
Router
84+
------
85+
The router component uses `Nginx`_ to route traffic to application containers.
86+
87+
.. _store:
88+
89+
Store
90+
------
91+
The store component uses `Ceph`_ to store data for Deis components
92+
which need to store state, including :ref:`Registry`, :ref:`Database`
93+
and :ref:`Logger`.
94+
95+
.. _`Amazon S3`: http://aws.amazon.com/s3/
96+
.. _`Celery`: http://www.celeryproject.org/
97+
.. _`Ceph`: http://ceph.com
98+
.. _`Docker`: http://docker.io/
99+
.. _`etcd`: https://github.com/coreos/etcd
100+
.. _`Git`: http://git-scm.com/
101+
.. _`Nginx`: http://nginx.org/
102+
.. _`OpenStack Storage`: http://www.openstack.org/software/openstack-storage/
103+
.. _`PostgreSQL`: http://www.postgresql.org/
104+
.. _`progrium's logspout`: https://github.com/progrium/logspout
105+
.. _`Redis`: http://redis.io/

docs/understanding_deis/concepts.rst

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,23 @@
55

66
Concepts
77
========
8-
Deis is a lightweight, flexible and powerful application platform that
9-
deploys and scales :ref:`concepts_twelve_factor` apps as
10-
:ref:`concepts_docker` containers across a cluster of
11-
:ref:`concepts_coreos` machines.
8+
Deis is a lightweight application platform that deploys and scales
9+
:ref:`concepts_twelve_factor` apps as :ref:`concepts_docker` containers
10+
across a cluster of :ref:`concepts_coreos` machines.
1211

1312
.. _concepts_twelve_factor:
1413

1514
Twelve-Factor
1615
-------------
17-
The `Twelve-Factor App`_ is a DevOps manifesto for building and
18-
deploying scalable, modern applications and services.
16+
The `Twelve-Factor App`_ is a methodology for building modern
17+
applications that can be scaled across a distributed system.
1918

2019
We consider it an invaluable synthesis of much experience with
2120
software-as-a-service apps in the wild, especially on the
2221
Heroku platform.
2322

24-
Deis works best with applications in a `Twelve-Factor App`_ style.
25-
Following the twelve-factor model, Deis enforces a strict separation of
26-
the :ref:`Build and Run <concepts_build_release_run>` stages.
23+
Deis is designed to run applications that adhere to `Twelve-Factor App`_
24+
methodology and best practices.
2725

2826
.. _concepts_docker:
2927

@@ -32,57 +30,54 @@ Docker
3230
`Docker`_ is an open source project to pack, ship and run any
3331
application as a lightweight, portable, self-sufficient container.
3432

35-
When you deploy an app with ``git push deis master``, Deis builds and
36-
packages it as a Docker image, then distributes it as Docker containers
37-
across your cluster.
33+
Deis curates your applications as Docker images, which are then
34+
distributed across your cluster as Docker containers.
3835

3936
(Deis itself is also a set of coordinated Docker containers.)
4037

4138
.. _concepts_coreos:
4239

4340
CoreOS
4441
------
45-
`CoreOS`_ is a lean new Linux distribution, rearchitected for features
46-
needed by modern infrastructure stacks and targeted at massive
47-
server deployments.
42+
`CoreOS`_ is a new, minimal Linux distribution, rearchitected for
43+
running modern, containerized infrastructure stacks.
4844

49-
Deis applications are processes running on CoreOS machines, which can
50-
be private or public cloud instances, or bare metal. CoreOS clusters
51-
allow Deis to host applications and services at scale with
52-
high resilience.
45+
Deis runs on CoreOS machines that be hosted anywhere -- public cloud,
46+
private cloud, bare metal or even your workstation.
5347

54-
Yet Deis and CoreOS run identically in a Vagrant virtual machine on
55-
your laptop, for convenient testing and rapid development.
48+
CoreOS allows Deis to host applications and services at scale with
49+
high resilience, in a way that is simple to operate.
5650

5751
.. _concepts_applications:
5852

5953
Applications
6054
------------
61-
An :ref:`application`, or app, lives on a cluster where it uses
62-
:ref:`Containers <container>` to process requests and run tasks for a
63-
deployed git repository.
55+
Deis is designed around the concept of an :ref:`application`, or app.
56+
Applications live on a cluster where they use :ref:`Containers <container>`
57+
to service requests.
6458

65-
Developers use :ref:`Applications <application>` to push code, change
66-
configuration, scale processes, view logs, or run admin commands --
67-
regardless of the cluster's underlying infrastructure.
59+
Developers use applications to push code, change configuration, scale processes,
60+
view logs, run admin commands and much more.
6861

6962
.. _concepts_build_release_run:
7063

7164
Build, Release, Run
7265
-------------------
7366

67+
.. image:: DeisGitPushWorkflow.png
68+
:alt: Deis Git Push Workflow
69+
7470
Build Stage
7571
^^^^^^^^^^^
76-
The :ref:`Controller` includes a *gitreceive* hook that receives incoming git push requests over
77-
SSH and builds applications inside ephemeral Docker containers. Tarballs of the /app directory are
78-
extracted into a slug and is injected into another container, which will create the app image. The
79-
image is then pushed to a private registry for later execution.
72+
The :ref:`builder` processes incoming ``git push`` requests builds applications
73+
inside ephemeral Docker containers, creating a new Docker image.
8074

8175
Release Stage
8276
^^^^^^^^^^^^^
8377
During the release stage, a :ref:`build` is combined with :ref:`config` to create a new numbered
84-
:ref:`release`. The release stage is triggered any time a new build is created or config is
85-
changed, making it easy to rollback code and configuration.
78+
:ref:`release`. This release is then pushed to a Docker registry for later execution.
79+
The release stage is triggered any time a new build is created or config is
80+
changed, making it easy to rollback code and configuration changes.
8681

8782
Run Stage
8883
^^^^^^^^^
@@ -99,14 +94,13 @@ Deis treats databases, caches, storage, messaging systems, and other
9994
`backing services`_ as attached resources, in keeping with Twelve-Factor
10095
best practices.
10196

102-
Applications can be decoupled this way, using simple
103-
`environment variables`_ to configure and attach to any services needed.
104-
Apps are then free to scale up independently, to use services provided
105-
by other apps, or to switch easily to external or third-party vendor
106-
services.
97+
Applications are attached to backing services using `environment variables`_.
98+
Because applications are decoupled from backing services, apps are free to scale up independently,
99+
to swap services provided by other apps, or to switch to external or third-party vendor services.
107100

108101
See Also
109102
--------
103+
* :ref:`Architecture`
110104
* :ref:`Using Deis <using_deis>`
111105
* :ref:`Managing Deis <managing_deis>`
112106
* The `Twelve-Factor App`_

docs/understanding_deis/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Understanding Deis
1010

1111
concepts
1212
architecture
13+
components

0 commit comments

Comments
 (0)