diff --git a/k8s-cluster-overview-azure.png b/k8s-cluster-overview-azure.png new file mode 100644 index 0000000..9eddf92 Binary files /dev/null and b/k8s-cluster-overview-azure.png differ diff --git a/k8s-cluster-overview.py b/k8s-cluster-overview.py new file mode 100644 index 0000000..7018f0a --- /dev/null +++ b/k8s-cluster-overview.py @@ -0,0 +1,40 @@ +from diagrams import Diagram, Edge, Cluster +from diagrams.azure.network import ApplicationGateway, LoadBalancers +from diagrams.azure.compute import AKS, KubernetesServices, ContainerRegistries +from diagrams.azure.storage import StorageAccounts +from diagrams.azure.database import DatabaseForPostgresqlServers +from diagrams.azure.monitor import Monitor + +with Diagram("Kubernetes Cluster Overview (Azure)", filename="k8s-cluster-overview-azure", show=False, direction="LR"): + # External traffic + app_gw = ApplicationGateway("App Gateway / ALB") + + # Kubernetes cluster (AKS) + with Cluster("AKS Cluster"): + aks = AKS("AKS") + pod1 = KubernetesServices("Pod: app-1") + pod2 = KubernetesServices("Pod: app-2") + + # Supporting services + acr = ContainerRegistries("ACR") + blob = StorageAccounts("Blob Storage (PV)") + db = DatabaseForPostgresqlServers("Azure DB for PostgreSQL") + monitor = Monitor("Azure Monitor") + + # Interactions + app_gw >> Edge(label="Ingress") >> aks + aks >> Edge(label="Schedules/Routes") >> pod1 + aks >> Edge(label="Schedules/Routes") >> pod2 + + pod1 >> Edge(label="Store PVC") >> blob + pod2 >> Edge(label="Store PVC") >> blob + + pod1 >> Edge(label="Query") >> db + pod2 >> Edge(label="Query") >> db + + acr >> Edge(label="Images") >> aks + + # Monitoring + aks >> monitor + db >> monitor + blob >> monitor diff --git a/serverless-architecture.png b/serverless-architecture.png new file mode 100644 index 0000000..c3062b0 Binary files /dev/null and b/serverless-architecture.png differ diff --git a/serverless-architecture.py b/serverless-architecture.py new file mode 100644 index 0000000..0841b64 --- /dev/null +++ b/serverless-architecture.py @@ -0,0 +1,46 @@ +from diagrams import Diagram, Cluster +from diagrams.aws.compute import Lambda +from diagrams.aws.database import Dynamodb +from diagrams.aws.storage import S3 +from diagrams.aws.network import APIGateway +from diagrams.aws.security import Cognito +from diagrams.aws.integration import SNS, SQS +from diagrams.aws.management import Cloudwatch + + +with Diagram("Serverless Architecture", show=True, filename="serverless-architecture", outformat="png"): + # Public API + Auth + api_gateway = APIGateway("API Gateway") + user_auth = Cognito("Cognito User Pool") + + # Core compute and storage + lambda_function = Lambda("API Lambda") + dynamodb = Dynamodb("DynamoDB") + s3 = S3("S3") + + # Async messaging and worker + sns = SNS("SNS Topic") + sqs = SQS("SQS Queue") + worker = Lambda("Worker Lambda") + + # Monitoring + cw = Cloudwatch("CloudWatch") + + # Group the serverless backend for clarity + with Cluster("Serverless Backend"): + lambda_function >> dynamodb + lambda_function >> s3 + lambda_function >> sns + + # Async delivery to worker via SQS subscription + sns >> sqs + sqs >> worker + + # API and auth flow + api_gateway >> user_auth + api_gateway >> lambda_function + + # Monitoring connections (informational) + lambda_function >> cw + worker >> cw + dynamodb >> cw