-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathkubernetes_on_premise.d2
executable file
·128 lines (108 loc) · 3.35 KB
/
kubernetes_on_premise.d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/usr/bin/env d2 --theme 200
#
# Author: Hari Sekhon
# Date: 2023-05-06 00:27:56 +0100 (Sat, 06 May 2023)
#
# vim:ts=2:sts=2:sw=2:et:filetype=d2
#
# https://github.com/HariSekhon/Diagrams-as-Code
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
# ============================================================================ #
# K u b e r n e t e s O n - p r e m i s e
# ============================================================================ #
direction: right
title: {
label: Kubernetes On-Premise
near: top-center
shape: text
style.font-size: 40
style.underline: true
}
classes: {
dns: {
label: DNS
icon: https://icons.terrastruct.com/gcp%2FProducts%20and%20services%2FNetworking%2FCloud%20DNS.svg
shape: image
}
network: {
# icon: https://icons.terrastruct.com/essentials%2F092-network.svg
# icon: https://diagrams.mingrammer.com/img/resources/onprem/network/haproxy.png
icon: https://diagrams.mingrammer.com/img/resources/gcp/network/routes.png
shape: image
}
storage: {
label: "HA Networked Storage\nfor Kubernetes\nPersistent Volumes"
icon: https://icons.terrastruct.com/azure%2FStorage%20Service%20Color%2FGeneral%20Storage.svg
shape: image
}
load_balancer: {
label: "HA Load Balancer\n(HAProxy / Nginx / Traefik / Kong)"
# there isn't a good generic load balancer icon so using this for now - switch to one of the product specific icons if you know which one
# icon: https://diagrams.mingrammer.com/img/resources/aws/network/elastic-load-balancing.png
icon: https://diagrams.mingrammer.com/img/resources/onprem/network/haproxy.png
# icon: https://diagrams.mingrammer.com/img/resources/onprem/network/kong.png
# icon: https://diagrams.mingrammer.com/img/resources/onprem/network/traefik.png
# icon: https://landscape.cncf.io/logos/metal-lb.svg
shape: image
}
k8s: {
icon: https://icons.terrastruct.com/azure%2F_Companies%2FKubernetes.svg
shape: image
}
k8s_ingress: {
icon: https://diagrams.mingrammer.com/img/resources/k8s/network/ing.png
shape: image
}
server: {
icon: https://icons.terrastruct.com/essentials%2F112-server.svg
}
}
users -> DNS -> user_network
DNS.class: dns
users: Users {
icon: https://icons.terrastruct.com/essentials%2F359-users.svg
shape: image
}
user_network: Network {class: network}
user_network -> lb1
user_network -> lb2
lb1: {class: load_balancer}
lb2: {class: load_balancer}
lb1 -> network
lb2 -> network
network: Network {
class: network
# style.opacity: 0
}
network -> Server 1
network -> Server 2
network -> Server 3
Server 1: {
class: server
kube1: Kubernetes 1 {class: k8s}
}
Server 2: {
class: server
kube2: Kubernetes 2 {class: k8s}
}
Server 3: {
class: server
kube3: Kubernetes 3 {class: k8s}
}
# Server 1 -- Server 2 -- Server 3: VRRP {style.stroke-dash: 5}
# Server 2 -- Server 3: VRRP {style.stroke-dash: 5}
# keepalived1: KeepAlive 1
# keepalived2: KeepAlive 2
# lb1 -- keepalived1 -- keepalived2 -- lb2
Server 1 -> storage_network
Server 2 -> storage_network
Server 3 -> storage_network
storage_network: Network {class: network}
storage_network -> storage
storage: {class: storage}