Update 'The Lab'

master
parent a8ac1e1ef8
commit b457b0478f

@ -1,19 +1,10 @@
# Networking
Here's a simple flow diagram about what a connection does until it hits the conainer that executes each service.
```
┌───────────────────────────┐ ┌──────────────────────────┐
│ Very small and cheap VM │ │ My home server │
│ │ │ │
│ │ │ │
┌─────┐ │ ┌───────┐ ┌─────────┐ │ │ ┌─────────┐ ┌────────┐ │
│ You ├──┼──► Caddy ├──► Rathole ├───┼──┼─► Rathole ├───► Docker │ │
└─────┘ │ └───────┘ └─────────┘ │ │ └─────────┘ └────────┘ │
│ │ │ │
└───────────────────────────┘ └──────────────────────────┘
```
![Networking](https://git.guillemborrell.es/guillem/know/raw/branch/main/pics/networking.png)
* Caddy for auto HTTPS. Caddy provides the equivalent to an cloud "application load balancer" service
* Rathole for NAT traversal. Rathole provides the equivalent to a cloud "network load balancer" service
* Rathole for NAT traversal. Rathole provides the equivalent to a cloud "network load balancer" service. Some services like SSH are exposed directly from the VM
* Docker and docker compose to run all services
@ -104,5 +95,47 @@ Certificate authorities require that the service that requests the cert runs in
Servers don't rotate the IP while on. If you ever need to restart the VM, then just change the A records in the DNS configuration. Of course you can allocate a static IP for your VM, but it will be more expensive than the VM itself.
# Storage
## File storage
The lab runs an instance of [minio](https://min.io/)
## RDBMS
There are multiple services in the lab that require a RDBMS. Postgresql is supported by all of them, so Postgresql it is. The usual practice when one deploys with docker compose is to create a separate database server for each service, but considering the capabilities of Postgresql, this is definitely an overkill. My decision has been to run postgres 14 on the server, and make it accessible to the containers by adding the following section in the docker compose file:
```
extra_hosts:
- host.docker.internal:host-gateway
```
This would be analogous to runing a managed DRBMS service, like Azure PostgreSQL or Aurora PostgreSQL. This means that one has to manage database creation, accounts, and passwords separately. This is how the database looks after deploying the whole thing:
```
~$ sudo -u postgres psql postgres
[sudo] password for guillem:
could not change directory to "/home/guillem": Permission denied
psql (14.4 (Ubuntu 14.4-0ubuntu0.22.04.1))
Type "help" for help.
postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
------------+----------+----------+-------------+-------------+-----------------------
ci | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
dw | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres +
| | | | | postgres=CTc/postgres+
| | | | | dw=CTc/postgres
gitea | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
jupyterhub | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
metabase | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(8 rows)
```
# Services
# Backups
# Backups
There's a specific page about backups [here](Backing-up-stuff-in-Google-Cloud-Storage)
Loading…
Cancel
Save