Last active
April 5, 2021 02:33
-
-
Save xNok/2242b329bcb2bfad363a4a0625a81ebb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from diagrams import Diagram, Cluster, Edge | |
from diagrams.custom import Custom | |
from diagrams.onprem.compute import Server | |
from diagrams.onprem.monitoring import Grafana, Prometheus | |
from diagrams.onprem.container import Docker | |
from diagrams.onprem.database import Mongodb | |
from diagrams.onprem.iac import Ansible | |
from diagrams.onprem.ci import GithubActions | |
with Diagram(name="Startup infra for small self hosted project", show=False): | |
ansible = Ansible("Ansible") | |
actions = GithubActions("Github Actions") | |
with Cluster("Master worker"): | |
ingress = Custom("ingress", "/out/caddy2.png") | |
with Cluster("Observability"): | |
# Docker | |
portainer = Custom("portainer", "/out/portainer.png") | |
registery = Docker("Private Registery") | |
ingress >> portainer >> registery | |
# Prometheus | |
metrics = Prometheus("Prometheus") | |
graphana = Grafana("Grafana") | |
ingress >> graphana >> metrics | |
# Provisioning | |
ob = [metrics, graphana, portainer, registery] | |
ob << Edge(color="firebrick", style="dashed") << ansible | |
with Cluster("Application worker", direction="TB"): | |
app = Server("Application") | |
db = Mongodb("Database") | |
ingress >> app >> db | |
# CI/CD | |
registery \ | |
<< Edge(color="firebrick", style="dashed") << actions \ | |
>> Edge(color="firebrick", style="dashed") >> [db, app] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment