Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects

Extra chart with connections.

Merged Diego MENDEZ requested to merge docs/mermaid_charts into main

Files

+ 21
29
@@ -14,48 +14,40 @@ Its primary use is to manage PostgreSQL database dumps used for the persistence
Netbox Backup Agent is installed in a [Netbox](https://netboxlabs.com/oss/netbox/) + [Netbox Docker Plugin](https://github.com/SaaShup/netbox-docker-plugin) + [Netbox Docker Agent](https://github.com/SaaShup/netbox-docker-agent) ecosystem.
### Flowchart for create and restore dumps.
```mermaid
flowchart TD
%%%%%%%%%%%%
%% flowchart for Create && restore
%% flowchart, backup-agent connections
%%%%%%%%%%%%
subgraph subGraph1["Full Netbox."]
M("Netbox docker-plugin")
N("fa:fa-database Postgres")
O("fa:fa-box Netbox")
P("fa:fa-database Redis")
end
F[("Dump's volume")]
AA("fa:fa-users Database Owner") --> C(["fa:fa-sun Backup-Agent"])
A("Netbox Docker-Agent") --> N
C --> A
N <--> F
E(Create && restore dump.)
style E fill:#fff,stroke:#bb,stroke-width:1px,color:#bb,stroke-dasharray: 5 5
```
### Flowchart for list, get, delete and upload dumps.
```mermaid
flowchart TD
%%%%%%%%%%%%
%% flowchart for list, get, delete and upload.
%%%%%%%%%%%%
F[("Dump's volume")]
AA("fa:fa-users Database Owner") --> C(["fa:fa-sun Backup-Agent"])
C --> F
A("Netbox Docker-Agent") <--> M
C <--Create && Restore dump.--> A
C <==List, Get, Delete && Upload a dump.====> F
N <--Create && Restore dump.--> F
M <--> N
%% fill
style C fill:#E1BEE7
%% linkStyle
linkStyle 1 stroke:#AA00FF,fill:none
linkStyle 2 stroke:#AA00FF,fill:none
linkStyle 4 stroke:#AA00FF
linkStyle 5 stroke:#AA00FF,fill:none
E(List, Get, Delete && Upload a dump.)
style E fill:#fff,stroke:#bb,stroke-width:1px,color:#bb,stroke-dasharray: 5 5
```
In order to read and list dumps, *Netbox Backup Agent* must have access to the dumps. To do this, we mount the volume containing the dumps in the *Netbox Backup Agent* Docker container. This volume is also mounted in the *PostgreSQL Database* container in order to write the dumps produced by the pg_dump binary distributed in this same container.
### Create Dump (outdated)
Thanks to the exec functionality exposed by the Netbox Docker Plugin, we can directly execute the dump command in the database container. In this way it is not necessary to distribute the dump binary (here with PosgreSQL `pg_dump`) with the Netbox Backup Agent.
Thanks to the exec functionality exposed by the Netbox Docker Plugin, we can directly execute the dump command in the database container. In this way it is not necessary to distribute the dump binary (here with PostgreSQL `pg_dump`) with the Netbox Backup Agent.
It should create a compressed `gzip` binary dump file.
```mermaid
@@ -123,8 +115,8 @@ sequenceDiagram
### Upload a Dump file
It will save file on a shared volume with postgres container.
It should work with a commpresed 'gzip' file, or uncompressed binary dump file.
It will save file on a shared volume with Postgres container.
It should work with a compressed 'gzip' file, or uncompressed binary dump file.
```mermaid
sequenceDiagram
@@ -139,7 +131,7 @@ sequenceDiagram
### Restore Dump file
It will connect to Docker-Agent API and execute "pg_restore" command from there.
It should work with a commpresed 'gzip' file, or uncompressed binary dumb file.
It should work with a compressed 'gzip' file, or uncompressed binary dumb file.
```mermaid
sequenceDiagram
@@ -269,6 +261,6 @@ volumes:
driver: local
```
We invite you to consult [the main REAME.md file](../README.md) to learn about the various environment variables available.
We invite you to consult [the main README.md file](../README.md) to learn about the various environment variables available.
In our diagram, we show that the Netbox Backup Agent is installed in the same Docker Host as the PostgreSQL Database container. However, it is possible to externalize the agent to another execution context, as long as the agent has access to the Dumps via a directory.
In our diagram, we show that the Netbox Backup Agent is installed in the same Docker Host as the PostgreSQL Database container. However, it is possible to externalise the agent to another execution context, as long as the agent has access to the Dumps via a directory.
Loading