awacke1 commited on
Commit
1f37f4b
·
1 Parent(s): 1c5c9ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -28
app.py CHANGED
@@ -1,28 +1,10 @@
1
- import streamlit as st
2
- from diagrams import Diagram, Cluster
3
- from diagrams.azure.network import VirtualNetwork, LoadBalancer, TrafficManager
4
-
5
- def main():
6
- st.set_page_config(page_title="Azure Network Diagram Demo")
7
-
8
- with st.sidebar:
9
- st.title("Azure Network Diagram Demo")
10
-
11
- with st.container():
12
- st.header("Azure Network Diagram")
13
-
14
- with Diagram("Azure Network Diagram", show=False):
15
- with Cluster("Azure"):
16
- vn = VirtualNetwork("Virtual Network")
17
- lb = LoadBalancer("Load Balancer")
18
- tm = TrafficManager("Traffic Manager")
19
-
20
- vn >> lb >> tm
21
-
22
- st.markdown("#### Legend")
23
- st.markdown("- Virtual Network: A virtual network to isolate your Azure resources.")
24
- st.markdown("- Load Balancer: A traffic distribution tool for Azure resources.")
25
- st.markdown("- Traffic Manager: A DNS-based traffic routing service.")
26
-
27
- if __name__ == '__main__':
28
- main()
 
1
+ from diagrams import Diagram
2
+ from diagrams.k8s.clusterconfig import HPA
3
+ from diagrams.k8s.compute import Deployment, Pod, ReplicaSet
4
+ from diagrams.k8s.network import Ingress, Service
5
+
6
+ with Diagram("Exposed Pod with 3 Replicas", show=False):
7
+ net = Ingress("domain.com") >> Service("svc")
8
+ net >> [Pod("pod1"),
9
+ Pod("pod2"),
10
+ Pod("pod3")] << ReplicaSet("rs") << Deployment("dp") << HPA("hpa")