Skip to content

Commit 2a06db8

Browse files
YZXBizclaude
andcommitted
Convert Insight boxes to admonitions and add React diagram components
- Fix chapter 5 title to match other chapters (Chapter 5: ...) - Convert 52 Insight boxes from code formatting to :::info[Insight] admonitions - Replace ASCII diagrams with React components in chapters 4, 7, 8, 10: - ch04: Pod architecture diagrams → StackDiagram, CardGrid, ProcessFlow - ch07: Service routing → StackDiagram - ch08: Ingress flow → ProcessFlow - ch10: Service discovery → ProcessFlow, StackDiagram, CardGrid 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9c05e34 commit 2a06db8

17 files changed

+410
-345
lines changed

docs/docs/01-kubernetes-primer.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ Kubernetes orchestrates your applications by:
5252
| Manual updates | Rolling updates with zero downtime |
5353
| Manual monitoring | Built-in health checking |
5454

55-
`Insight ─────────────────────────────────────`
55+
:::info[Insight]
5656
The best orchestration is invisible. When Kubernetes works properly, applications simply function - scaling during traffic spikes, recovering from failures, and updating seamlessly. The complexity is hidden, but the operational benefits are immense.
57-
`─────────────────────────────────────────────────`
57+
:::
5858

5959
### 1.2. Containerization Technology
6060

@@ -132,9 +132,9 @@ Microservices applications are built from many small, specialized, independent s
132132
**Operational Considerations:**
133133
Microservices provide unprecedented flexibility but require sophisticated orchestration to manage distributed system complexity. This is where Kubernetes provides essential coordination capabilities.
134134

135-
`Insight ─────────────────────────────────────`
135+
:::info[Insight]
136136
Microservices aren't just about technology - they're fundamentally about organizational structure. Each service enables independent team ownership, release cycles, and technology choices, creating flexibility that requires orchestration platforms like Kubernetes to manage effectively.
137-
`─────────────────────────────────────────────────`
137+
:::
138138

139139
## 3. The Story Behind Kubernetes
140140

@@ -256,9 +256,9 @@ Kubernetes enables true application portability across different infrastructure
256256
- **Vendor Independence**: Avoid cloud provider lock-in through standardized APIs
257257
- **Migration Flexibility**: Move workloads based on cost, performance, or compliance requirements
258258
259-
`Insight ─────────────────────────────────────`
259+
:::info[Insight]
260260
The power of abstraction lies in hiding complexity while providing enhanced capabilities. Just as modern operating systems manage thousands of processes across multiple CPU cores, Kubernetes manages thousands of applications across multiple cloud data centers with similar elegance.
261-
`─────────────────────────────────────────────────`
261+
:::
262262
263263
---
264264
@@ -310,9 +310,9 @@ Kubernetes enables organizations of any size to operate with the same sophistica
310310
**Looking Forward:**
311311
Subsequent chapters will explore Kubernetes internal architecture, installation procedures, and practical application deployment scenarios. The foundational concepts covered here provide the context for understanding Kubernetes' technical implementation and operational patterns.
312312
313-
`Insight ─────────────────────────────────────`
313+
:::info[Insight]
314314
Kubernetes represents more than technology advancement - it enables new organizational and operational patterns. Small teams can now operate resilient, scalable applications with automation and reliability previously available only to companies with Google's resources and expertise.
315-
`─────────────────────────────────────────────────`
315+
:::
316316
317317
---
318318

docs/docs/02-kubernetes-principles.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ A Kubernetes cluster provides the computing infrastructure for applications thro
5858
- **Scalability**: Add or remove nodes based on demand
5959
- **Abstraction**: Hide infrastructure complexity from applications
6060

61-
`Insight ─────────────────────────────────────`
61+
:::info[Insight]
6262
Kubernetes abstracts distributed computing complexity similarly to how a concert hall abstracts acoustics and power management. Applications simply "show up and perform" without worrying about underlying infrastructure details.
63-
`─────────────────────────────────────────────────`
63+
:::
6464

6565
### 1.2. Control Plane Nodes
6666

@@ -408,9 +408,9 @@ spec:
408408
4. **Corrective Actions**: Controllers make necessary changes
409409
5. **Continuous Monitoring**: Controllers maintain desired state over time
410410
411-
`Insight ─────────────────────────────────────`
411+
:::info[Insight]
412412
The declarative model separates intent from implementation. You describe the "musical piece" you want performed, and Kubernetes orchestrates all the complex coordination needed to make it happen continuously and reliably.
413-
`─────────────────────────────────────────────────`
413+
:::
414414
415415
### 4.2. Pods
416416
@@ -621,9 +621,9 @@ Client → Service (stable IP) → kube-proxy → Pod (dynamic IP)
621621
- **Session Affinity**: Route requests from same client to same pod
622622
- **Least Connections**: Route to pod with fewest active connections (external LB)
623623

624-
`Insight ─────────────────────────────────────`
624+
:::info[Insight]
625625
Services solve the "moving target" problem inherent in dynamic container environments. Without Services, connecting to applications would be like trying to call specific musicians during a performance - you'd never know if they're available or where to reach them.
626-
`─────────────────────────────────────────────────`
626+
:::
627627

628628
---
629629

@@ -669,9 +669,9 @@ This chapter explored the fundamental principles and architecture that enable Ku
669669
**Looking Forward:**
670670
Subsequent chapters will build on these architectural concepts to explore Kubernetes installation, configuration, and practical application deployment scenarios. The principles covered here underpin all Kubernetes operations.
671671

672-
`Insight ─────────────────────────────────────`
672+
:::info[Insight]
673673
Kubernetes success stems from clear architectural separation of concerns - like a well-orchestrated symphony where each section has specific responsibilities but all work toward creating beautiful music. This organizational clarity enables both reliable operations and sophisticated automation.
674-
`─────────────────────────────────────────────────`
674+
:::
675675

676676
---
677677

docs/docs/03-getting-kubernetes.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ Your Kubernetes learning environment should progress from simple to complex base
7979
**Cost-Effective Approach:**
8080
Start with local development for foundational concepts, then use cloud environments only when specific cloud-native features are required.
8181

82-
`Insight ─────────────────────────────────────`
82+
:::info[Insight]
8383
Master fundamentals locally before moving to cloud environments. This approach builds solid foundations while minimizing costs and complexity during the learning process.
84-
`─────────────────────────────────────────────────`
84+
:::
8585

8686
---
8787

@@ -230,9 +230,9 @@ This local setup supports:
230230
- ConfigMap and Secret management
231231
- Most Kubernetes learning scenarios
232232

233-
`Insight ─────────────────────────────────────`
233+
:::info[Insight]
234234
This local cluster handles 90% of Kubernetes learning scenarios. Master Pods, Deployments, Services, and advanced concepts locally before moving to cloud environments for specific integrations.
235-
`─────────────────────────────────────────────────`
235+
:::
236236

237237
---
238238

@@ -418,9 +418,9 @@ lke349416-551020-47ad6c5c0000 Ready <none> 19m v1.32.1
418418
- **Authentication failures**: Confirm kubeconfig downloaded correctly
419419
- **Context issues**: Use `kubectl config current-context` to verify active cluster
420420

421-
`Insight ─────────────────────────────────────`
421+
:::info[Insight]
422422
Managed clusters hide infrastructure complexity while providing production features. You only see worker nodes, but gain access to cloud load balancers, persistent storage, and enterprise-grade reliability.
423-
`─────────────────────────────────────────────────`
423+
:::
424424

425425
---
426426

@@ -546,9 +546,9 @@ Docker Desktop provides graphical context switching through the whale icon menu
546546
- **Backup Strategy**: Maintain secure backups of working configurations
547547
- **Environment Separation**: Use separate contexts for different environments
548548

549-
`Insight ─────────────────────────────────────`
549+
:::info[Insight]
550550
kubeconfig enables seamless multi-cluster workflows. Develop locally, test in staging, and deploy to production using identical kubectl commands - context switching changes the target cluster without changing your workflow.
551-
`─────────────────────────────────────────────────`
551+
:::
552552

553553
---
554554

docs/docs/04-working-with-pods.md

Lines changed: 99 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Chapter 4: Working with Pods
22

3+
import { ProcessFlow, StackDiagram, CardGrid, colors } from '@site/src/components/diagrams';
4+
35
**Previous:** [Chapter 3: Getting Kubernetes](03-getting-kubernetes.md) | **Next:** [Chapter 5: Virtual Clusters and Namespaces](05-virtual-clusters-namespaces.md)
46

57
---
@@ -74,20 +76,21 @@ Pods enable resource sharing by providing a shared execution environment for one
7476

7577
**Multi-Container Pod Architecture:**
7678

77-
```
78-
Pod: web-application (IP: 10.244.1.5)
79-
┌─────────────────────────────────────────┐
80-
│ │
81-
│ ┌─────────────┐ ┌─────────────────┐ │
82-
│ │ Web Server │ │ Log Collector │ │
83-
│ │ Port: 8080 │ │ Port: 5005 │ │
84-
│ │ │ │ │ │
85-
│ └─────────────┘ └─────────────────┘ │
86-
│ │ │ │
87-
│ └── Shared Volume ───┘ │
88-
│ │
89-
└─────────────────────────────────────────┘
90-
```
79+
<StackDiagram
80+
title="Pod: web-application (IP: 10.244.1.5)"
81+
layers={[
82+
{
83+
label: 'Containers',
84+
color: colors.blue,
85+
items: ['Web Server (Port: 8080)', 'Log Collector (Port: 5005)']
86+
},
87+
{
88+
label: 'Shared Resources',
89+
color: colors.slate,
90+
items: ['Shared Volume']
91+
}
92+
]}
93+
/>
9194

9295
**Container Communication Patterns:**
9396
- **External Access**: `10.244.1.5:8080` (web) and `10.244.1.5:5005` (logs)
@@ -181,9 +184,9 @@ spec:
181184
- **Pending**: No suitable node found (check resources/constraints)
182185
- **Failed**: Scheduling impossible (insufficient cluster capacity)
183186
184-
`Insight ─────────────────────────────────────`
187+
:::info[Insight]
185188
Resource requests and limits are critical for scheduling efficiency. Without them, the scheduler cannot make optimal decisions and may place workloads on inadequate nodes, leading to performance issues.
186-
`─────────────────────────────────────────────────`
189+
:::
187190
188191
### 1.4. Pod Lifecycle
189192
@@ -255,19 +258,30 @@ Every Kubernetes cluster implements a pod network that automatically connects al
255258

256259
**Network Architecture:**
257260

258-
```
259-
Kubernetes Cluster Network
260-
┌──────────────────────────────────────────────────┐
261-
│ │
262-
│ Node 1 Node 2 Node 3 │
263-
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
264-
│ │ Pod A │ │ Pod B │ │ Pod C │ │
265-
│ │ 10.1.1.2 │◄──►│ 10.1.2.5 │◄──►│ 10.1.3.8 │ │
266-
│ └──────────┘ └──────────┘ └──────────┘ │
267-
│ │
268-
│ Pod Network: Direct communication across nodes │
269-
└──────────────────────────────────────────────────┘
270-
```
261+
<CardGrid
262+
cards={[
263+
{
264+
title: 'Node 1',
265+
description: 'Pod A',
266+
items: ['IP: 10.1.1.2'],
267+
color: colors.blue
268+
},
269+
{
270+
title: 'Node 2',
271+
description: 'Pod B',
272+
items: ['IP: 10.1.2.5'],
273+
color: colors.green
274+
},
275+
{
276+
title: 'Node 3',
277+
description: 'Pod C',
278+
items: ['IP: 10.1.3.8'],
279+
color: colors.purple
280+
}
281+
]}
282+
/>
283+
284+
**Pod Network: Direct communication across nodes**
271285

272286
**CNI Plugin Options:**
273287

@@ -308,9 +322,9 @@ spec:
308322
- **Application Segmentation**: Multi-tier applications with controlled access
309323
- **Service Mesh**: Advanced traffic management and security
310324

311-
`Insight ─────────────────────────────────────`
325+
:::info[Insight]
312326
The pod network starts completely open for ease of use and learning. In production environments, implement network policies to control traffic flow, just like security checkpoints in logistics networks.
313-
`─────────────────────────────────────────────────`
327+
:::
314328

315329
---
316330

@@ -340,14 +354,25 @@ Init containers run before application containers and must complete successfully
340354

341355
**Execution Flow:**
342356

343-
```
344-
Init Container Sequence:
345-
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
346-
│ Init 1 │→ │ Init 2 │→ │ Application │
347-
│ Setup DB │ │ Check API │ │ Server │
348-
│ (must pass) │ │ (must pass) │ │ (starts) │
349-
└─────────────┘ └─────────────┘ └─────────────┘
350-
```
357+
<ProcessFlow
358+
steps={[
359+
{
360+
title: 'Init 1',
361+
description: 'Setup DB (must pass)',
362+
color: colors.orange
363+
},
364+
{
365+
title: 'Init 2',
366+
description: 'Check API (must pass)',
367+
color: colors.orange
368+
},
369+
{
370+
title: 'Application',
371+
description: 'Server (starts)',
372+
color: colors.green
373+
}
374+
]}
375+
/>
351376

352377
**Init Container Example:**
353378

@@ -414,16 +439,35 @@ Sidecars are defined as init containers with `restartPolicy: Always`, which make
414439

415440
**Sidecar Lifecycle:**
416441

417-
```
418-
Sidecar Container Lifecycle:
419-
┌─────────────────────────────────────────────┐
420-
│ 1. Sidecar starts first │
421-
│ 2. Main application starts after sidecar │
422-
│ 3. Both containers run together │
423-
│ 4. Main application shuts down │
424-
│ 5. Sidecar shuts down after main app │
425-
└─────────────────────────────────────────────┘
426-
```
442+
<ProcessFlow
443+
steps={[
444+
{
445+
title: 'Sidecar Starts',
446+
description: 'Sidecar container starts first',
447+
color: colors.purple
448+
},
449+
{
450+
title: 'Main App Starts',
451+
description: 'Main application starts after sidecar',
452+
color: colors.blue
453+
},
454+
{
455+
title: 'Running Together',
456+
description: 'Both containers run together',
457+
color: colors.green
458+
},
459+
{
460+
title: 'Main App Shutdown',
461+
description: 'Main application shuts down',
462+
color: colors.orange
463+
},
464+
{
465+
title: 'Sidecar Shutdown',
466+
description: 'Sidecar shuts down after main app',
467+
color: colors.red
468+
}
469+
]}
470+
/>
427471

428472
**Content Synchronization Example:**
429473

@@ -475,9 +519,9 @@ As of Kubernetes v1.29+, native sidecar support is in beta, providing:
475519
- **Lifecycle Management**: Proper shutdown sequencing
476520
- **Status Tracking**: Clear sidecar vs main container status
477521

478-
`Insight ─────────────────────────────────────`
522+
:::info[Insight]
479523
Sidecar containers implement the single responsibility principle - each container has one focused job. This separation makes components simpler, more reusable, and easier to troubleshoot than monolithic applications.
480-
`─────────────────────────────────────────────────`
524+
:::
481525

482526
---
483527

@@ -764,9 +808,9 @@ HOSTNAME=hello-pod
764808
| `kubectl logs` | Container output | Application debugging |
765809
| `kubectl exec` | Container access | Interactive debugging |
766810

767-
`Insight ─────────────────────────────────────`
811+
:::info[Insight]
768812
The Pod name becomes the hostname for all containers inside it, making networking and debugging intuitive. A Pod named "web-server" has hostname "web-server" for all its containers.
769-
`─────────────────────────────────────────────────`
813+
:::
770814

771815
### 4.4. Multi-Container Examples
772816

@@ -1012,9 +1056,9 @@ Pods are the fundamental building blocks of Kubernetes, providing a standardized
10121056
**Looking Forward:**
10131057
While Pods are fundamental, production deployments typically use higher-level controllers like Deployments, StatefulSets, and DaemonSets that provide additional capabilities like self-healing, scaling, and rolling updates.
10141058

1015-
`Insight ─────────────────────────────────────`
1059+
:::info[Insight]
10161060
Pods embody the separation of concerns principle - they handle application packaging and resource sharing while letting Kubernetes manage scheduling and orchestration. This separation enables the flexibility and power of the Kubernetes platform.
1017-
`─────────────────────────────────────────────────`
1061+
:::
10181062

10191063
---
10201064

docs/docs/05-virtual-clusters-namespaces.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 5. Virtual Clusters with Namespaces
1+
# Chapter 5: Virtual Clusters with Namespaces
22

33
*Understanding how Kubernetes organizes cluster resources through logical separation*
44

0 commit comments

Comments
 (0)