Skip to content

Commit 1960410

Browse files
committed
add mermaid diagrams to kcp concepts
Signed-off-by: olalekan odukoya <[email protected]>
1 parent 0d641dd commit 1960410

File tree

1 file changed

+130
-1
lines changed

1 file changed

+130
-1
lines changed

docs/content/concepts/terminology.md

Lines changed: 130 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,23 @@ tooling such as kubectl and client-go.
4747
We're working with the upstream community on adding support for the multi-cluster setups to the Kubernetes
4848
controller-runtime.
4949

50+
```mermaid
51+
graph TB
52+
subgraph KCP_Server ["KCP Server"]
53+
KS[Kubernetes API Server<br/>Core Components]
54+
KCP_Extensions[KCP Extensions<br/>APIBinding, Workspace,<br/>WorkspaceType, Partition, etc...]
55+
end
56+
57+
KS --> KCP_Extensions
58+
KCP_Extensions --> KS
59+
60+
User1[User/Team A] --> KCP_Server
61+
User2[User/Team B] --> KCP_Server
62+
Kubectl[kubectl] --> KCP_Server
63+
Client[Kubernetes Client] --> KCP_Server
64+
65+
```
66+
5067
## Logical Cluster
5168

5269
A logical cluster is a way to subdivide a kcp server and its `etcd` datastore into multiple clusters without requiring
@@ -85,9 +102,37 @@ such as Workspace, to create logical cluster.
85102
unless stated otherwise, what applies to a workspace applies to a logical cluster as well, because Workspaces are
86103
abstractions built on top of logical clusters.
87104

105+
```mermaid
106+
graph TB
107+
subgraph KCP_Server ["KCP Server"]
108+
subgraph WorkspaceLayer [Workspace Layer]
109+
WS1[Workspace: bobs<br/>Type: organization<br/>Phase: Ready]
110+
WS2[Workspace: alice<br/>Type: universal<br/>Phase: Ready]
111+
end
112+
113+
subgraph LogicalClusterLayer [Logical Cluster Layer - Auto-created]
114+
LC1[Logical Cluster<br/>:root:bobs]
115+
LC2[Logical Cluster<br/>:root:alice]
116+
end
117+
118+
subgraph StorageLayer [Storage Layer]
119+
ETCD[(etcd<br/>Single Storage Cluster)]
120+
end
121+
end
122+
123+
WS1 -->|auto-creates| LC1
124+
WS2 -->|auto-creates| LC2
125+
126+
LC1 -->|stores data in<br/>/bobs/ prefix| ETCD
127+
LC2 -->|stores data in<br/>/alice/ prefix| ETCD
128+
129+
User1[User: Bob] -->|kubectl ws use :root:bobs| LC1
130+
User2[User: Alice] -->|kubectl ws use :root:alice| LC2
131+
```
132+
88133
## Workspace
89134

90-
A Workspace is an abstraction used to create and provision logical clusters. Aside from creating the LogicalCluster
135+
A Workspace is an abstraction used to create and provision logical clusters. Aside from creating the `LogicalCluster`
91136
object, the responsibility of a Workspace is to initialize the given logical cluster by installing the required
92137
resources for the given workspace type, creating the initial objects, and more.
93138

@@ -108,6 +153,22 @@ A Workspace's path is based on the hierarchy and the user provided name. For exa
108153
The workspace path is used for building the workspace URL and for accessing the workspace via the `ws` kubectl plugin.
109154

110155
More information, including examples, can be found in the the [Workspaces document](workspaces/index.md).
156+
```mermaid
157+
graph TB
158+
Root[Root Workspace<br/>root]
159+
160+
Root --> Corp1[Acme Corp<br/>root:acme-corp]
161+
Root --> Corp2[Startup XYZ<br/>root:startup-xyz]
162+
163+
Corp1 --> Eng[Engineering<br/>root:acme-corp:engineering]
164+
Corp1 --> Mkt[Marketing<br/>root:acme-corp:marketing]
165+
166+
Eng --> Team1[App Team 1<br/>root:acme-corp:engineering:app-team-1]
167+
Eng --> Team2[App Team 2<br/>root:acme-corp:engineering:app-team-2]
168+
Eng --> Platform[Platform<br/>root:acme-corp:engineering:platform]
169+
170+
Corp2 --> Dev[Development<br/>root:startup-xyz:dev]
171+
```
111172

112173
### Workspace Types
113174

@@ -122,6 +183,29 @@ By default, each workspace has the [built-in APIs installed and available to its
122183

123184
More information, including a list of Workspace Types and examples, can be found in the
124185
[Workspace Types document](workspaces/workspace-types.md).
186+
```mermaid
187+
graph LR
188+
subgraph Types ["Workspace Types (Templates)"]
189+
OrgType[organization<br/>Pre-configured for organizational structure]
190+
UniversalType[universal<br/>General-purpose workspace]
191+
end
192+
193+
subgraph Instances ["Workspace Instances"]
194+
OrgWS[wildwestdebug<br/>TYPE: organization]
195+
UniversalWS[my-app-workspace<br/>TYPE: universal]
196+
end
197+
198+
subgraph Users ["User Personas"]
199+
Teams[Teams & Organizations]
200+
Developers[Individual Developers]
201+
end
202+
203+
OrgType -.->|instantiated as| OrgWS
204+
UniversalType -.->|instantiated as| UniversalWS
205+
206+
OrgWS -.->|used by| Teams
207+
UniversalWS -.->|used by| Developers
208+
```
125209

126210
## Virtual Workspaces
127211

@@ -187,6 +271,38 @@ The general workflow is:
187271
- Users can now create API resources of those types in their workspace. You can build and run controllers that are
188272
going to reconcile those resources across different workspaces.
189273

274+
```mermaid
275+
graph TB
276+
Title[API Exporting/Binding = Sharing Tools Between Workspaces/Logical Clusters]
277+
278+
subgraph ToolOwner [Infra: Has Unique Tools]
279+
Infra[Infra Workspace]
280+
SpecialTool[Special Database API <br/>PostgreSQL Operator]
281+
APIExport[API Export <br/> I'm sharing my Database tool]
282+
end
283+
284+
subgraph ToolUsers [App Teams - Need Tools]
285+
AppTeam1[App Team 1 Workspace]
286+
AppTeam2[App Team 2 Workspace]
287+
APIBinding1[API Binding <br/> I want to use Database tool]
288+
APIBinding2[API Binding <br/> I want to use Database tool]
289+
end
290+
291+
Title --> ToolOwner
292+
293+
Infra --> SpecialTool
294+
SpecialTool --> APIExport
295+
296+
APIExport -->|shares with| APIBinding1
297+
APIExport -->|shares with| APIBinding2
298+
299+
APIBinding1 --> AppTeam1
300+
APIBinding2 --> AppTeam2
301+
302+
AppTeam1 --> CanUse1[App Team 1: <br/>can now create PostgreSQL databases]
303+
AppTeam2 --> CanUse2[App Team 2: <br/>can now create PostgreSQL databases]
304+
```
305+
190306
## Shard
191307

192308
A failure domain within the larger control plane service that cuts across the primary functionality. Most distributed
@@ -218,3 +334,16 @@ available shards.
218334

219335
!!! note
220336
Depending on how you setup kcp, you might have front proxy running even though you don't have a sharded setup.
337+
338+
```mermaid
339+
graph TB
340+
Users[All Users & kubectl] --> FrontProxy[kcp-front-proxy<br/>Smart Router]
341+
342+
FrontProxy --> Shard1[Shard 1<br/>Workspaces: frontend-team, mobile-team]
343+
FrontProxy --> Shard2[Shard 2<br/>Workspaces: backend-team, data-team]
344+
FrontProxy --> Shard3[Shard 3<br/>Workspaces: platform-team, infra-team]
345+
346+
Shard1 --> etcd1[etcd Storage<br/>Frontend & Mobile data]
347+
Shard2 --> etcd2[etcd Storage<br/>Backend & Data team data]
348+
Shard3 --> etcd3[etcd Storage<br/>Platform & Infra data]
349+
```

0 commit comments

Comments
 (0)