Skip to content

Commit 5f1c255

Browse files
committed
Enhance Kubernetes YAML documentation with additional explanations and a warning about using Helm. Update CodeBlock and other components for improved styling and consistency. Remove unused status section from deployment details.
1 parent 7d20064 commit 5f1c255

File tree

16 files changed

+76
-66
lines changed

16 files changed

+76
-66
lines changed

docusaurus/docs/kubernetes/anatomy-of-kubernetes-yaml.mdx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,37 @@
22
title: Anatomy of Kubernetes YAML
33
---
44

5+
import Alert from "@site/src/components/Alert/index.tsx";
6+
7+
<Alert
8+
title="Helm - The package manager for Kubernetes"
9+
description="Keep in mind that throughout this entire journey, we will be writing our YAML files manually. In simple terms, we will not be using Helm (the package manager for Kubernetes). In my experience, introducing these abstractions too soon robs us of learning opportunities and understanding how these files are written. Trust this advice: follow this path until you are fully irritated doing it manually. At that point, you'll be ready to optimize."
10+
variant="warning"
11+
/>
12+
513
import KubernetesYAMLAnatomy from "@site/src/components/KubernetesYAMLAnatomy/index.tsx";
614

15+
Understanding Kubernetes YAML files is essential for working with Kubernetes. These declarative files define nearly every aspect of our infrastructure: how many instances of an application to run, what type of storage to use, access controls, networking, and more.
16+
17+
From now on, we should approach these concepts in a straightforward way, because that's really all there is to it. If we focus too much on terminology and fluff, it's easy to feel overwhelmed.
18+
19+
> It's important to think about each of these "components" naturally. For example: we want to deploy an application with an API and supporting services (x, y, z). We might need 10GB of storage for our Postgres database, and we want Postgres to be accessible only by our API. Finally, we need to expose our API to the internet.
20+
21+
Each major configuration area is typically represented by its own YAML file. For example:
22+
23+
- **Ingress**: Describes how a service is accessed via HTTP and HTTPS.
24+
- **Deployment**: Specifies how many instances (replicas) of an application to run, and resource allocations like RAM and CPU.
25+
- **Service**: Defines networking and how other components or users can access our application.
26+
27+
A typical Kubernetes YAML file is structured into several key sections ([Objects In Kubernetes](https://kubernetes.io/docs/concepts/overview/working-with-objects/)):
28+
29+
- **apiVersion**: Specifies the Kubernetes API version to use for this object.
30+
- **kind**: Indicates the type of Kubernetes object (e.g., Deployment, Service, Ingress).
31+
- **metadata**: Provides identifying information such as the object's name, namespace, and labels.
32+
- **spec**: Contains the desired state and configuration details for the object.
33+
34+
Each section plays a specific role in telling Kubernetes what we want to run and how we want it managed.
35+
36+
Mastering these files is key to effectively deploying and managing applications in Kubernetes.
37+
738
<KubernetesYAMLAnatomy />

docusaurus/src/components/CodeBlock/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const CodeBlock = ({
99
}) => {
1010
return (
1111
<div className="rounded-xl overflow-x-auto sticky">
12-
<pre className="!bg-gray-100/2">
12+
<pre className="!bg-transparent">
1313
<code>
1414
{sections.map(section => (
1515
<Fragment key={section.id}>

docusaurus/src/components/DataCenterOverview/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const DataCenterOverview = () => (
2323
<h4 className="font-semibold text-blue-400">1. Hardware Setup</h4>
2424
<DiagramBox className="w-full hover:border-blue-500">
2525
<p className="font-bold !mb-2">🛠️ Physical Infrastructure</p>
26-
<ul className="text-sm space-y-2 !mb-0">
26+
<ul className="space-y-2 !mb-0">
2727
<li>📦 Server Rack</li>
2828
<li>🍓 Raspberry Pi Cluster</li>
2929
<li>💻 Mini PCs</li>
@@ -37,7 +37,7 @@ const DataCenterOverview = () => (
3737
<h4 className="font-semibold text-green-400">2. Network Setup</h4>
3838
<DiagramBox className="w-full hover:border-green-500">
3939
<p className="font-bold !mb-2">🌐 Network Infrastructure</p>
40-
<ul className="text-sm space-y-2 !mb-0">
40+
<ul className="space-y-2 !mb-0">
4141
<li>📡 Mikrotik Router</li>
4242
<li>🔄 Managed Switch</li>
4343
<li>🔒 VLANs & Security</li>
@@ -51,7 +51,7 @@ const DataCenterOverview = () => (
5151
<h4 className="font-semibold text-purple-400">3. K3s Setup</h4>
5252
<DiagramBox className="w-full hover:border-purple-500">
5353
<p className="font-bold !mb-2">☸️ Kubernetes Layer</p>
54-
<ul className="text-sm space-y-2 !mb-0">
54+
<ul className="space-y-2 !mb-0">
5555
<li>🎮 Control Plane</li>
5656
<li>👷 Worker Nodes</li>
5757
<li>💾 Storage (Longhorn)</li>
@@ -66,7 +66,7 @@ const DataCenterOverview = () => (
6666
</h4>
6767
<DiagramBox className="w-full hover:border-yellow-500">
6868
<p className="font-bold !mb-2">🚀 Applications & Services</p>
69-
<ul className="text-sm space-y-2 !mb-0">
69+
<ul className="space-y-2 !mb-0">
7070
<li>🗄️ Databases - PostgreSQL, Redis</li>
7171
<li>🚪 Ingress - Traefik</li>
7272
<li>📊 Monitoring - Prometheus, Grafana</li>

docusaurus/src/components/ExplanationCard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const ExplanationCard = ({
1717
onMouseEnter={onMouseEnter}
1818
onMouseLeave={onMouseLeave}
1919
>
20-
<h3 className={`!mb-0 !text-sm !font-normal ${styles.titleColor}`}>
20+
<h3 className={`!mb-0 !font-normal ${styles.titleColor}`}>
2121
{section.title}
2222
</h3>
2323
<Tooltip id={`tooltip-${section.id}`} />

docusaurus/src/components/KubernetesParetoPrinciple/ProductionChecklistSection/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const ProductionChecklistSection = () => (
2222
<span className="font-semibold text-slate-800 dark:text-slate-200">
2323
{item.title}
2424
</span>
25-
<span className="ml-2 text-slate-500 dark:text-slate-400 text-sm font-normal">
25+
<span className="ml-2 text-slate-500 dark:text-slate-400 font-normal">
2626
{item.description}
2727
</span>
2828
</span>

docusaurus/src/components/KubernetesYAMLAnatomy/deployment.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,4 @@ export const sections = [
137137
"The heart of the Pod. A list of one or more containers to run, specifying the `image`, `ports`, etc.",
138138
indent: 6,
139139
},
140-
{
141-
id: "status",
142-
key: "status:",
143-
value: `
144-
availableReplicas: 3
145-
readyReplicas: 3`,
146-
title: "status",
147-
description:
148-
"The **actual state**. This field is read-only and is managed by Kubernetes to report the current status of the object.",
149-
comment: "# --- Status (Read-Only) ---",
150-
},
151140
];

docusaurus/src/components/KubernetesYAMLAnatomy/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export default function App() {
2828
return (
2929
<div className="flex flex-col items-center justify-center">
3030
<Tabs tabs={tabs} activeTab={activeTab} setActiveTab={setActiveTab} />
31-
<div className="text-center mt-6 text-sm"></div>
32-
<div>
31+
<div className="text-center mt-6"></div>
32+
<div className="w-full">
3333
<div className="rounded-2xl grid grid-cols-1 lg:grid-cols-12 gap-8 items-start w-full">
3434
{/* Left Side: YAML Code */}
3535
<div className="col-span-8">
@@ -42,7 +42,7 @@ export default function App() {
4242
</div>
4343

4444
{/* Right Side: Explanations */}
45-
<div className="flex flex-col space-y-2 col-span-4">
45+
<div className="space-y-2 col-span-4">
4646
{sections.map(section => (
4747
<ExplanationCard
4848
key={section.id}

docusaurus/src/components/MikrotikNetworking/CodeBlock/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const CodeBlock = ({ code }: CodeBlockProps) => {
3131
</Highlight>
3232
<button
3333
onClick={handleCopy}
34-
className="absolute top-2 right-2 bg-gray-700 hover:bg-gray-600 px-2 py-1 text-xs opacity-0 group-hover:opacity-100 transition-opacity"
34+
className="absolute top-2 right-2 bg-gray-700 hover:bg-gray-600 px-2 py-1 opacity-0 group-hover:opacity-100 transition-opacity"
3535
>
3636
{copied ? "Copied!" : "Copy"}
3737
</button>

docusaurus/src/components/MikrotikNetworking/DeviceConfiguration/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ const DeviceConfiguration = () => {
1414
<Section description="In this section, we will walk through the configuration for each device. It is best to start with a factory reset device.">
1515
<div className="border-b border-gray-800 mb-6">
1616
<nav className="-mb-px flex space-x-6 overflow-x-auto">
17-
{Object.keys(deviceConfigData).map((key) => (
17+
{Object.keys(deviceConfigData).map(key => (
1818
<button
1919
key={key}
2020
onClick={() => setActiveTab(key as keyof typeof deviceConfigData)}
2121
className={cx(
22-
"py-4 px-1 border-b-2 font-medium text-sm",
22+
"py-4 px-1 border-b-2 font-medium",
2323
activeTab === key
2424
? "border-[#ffab00] text-[#ffab00]"
2525
: "border-transparent hover:text-gray-200 hover:border-gray-500"
@@ -32,14 +32,14 @@ const DeviceConfiguration = () => {
3232
</div>
3333
<Accordion
3434
items={activeDevice.steps}
35-
getTitle={(item) => item.title}
36-
renderContent={(item) => (
35+
getTitle={item => item.title}
36+
renderContent={item => (
3737
<>
38-
<p className="text-sm mb-4">{item.description}</p>
38+
<p className="mb-4">{item.description}</p>
3939
<CodeBlock code={item.code} />
4040
</>
4141
)}
42-
stepPrefix={(idx) => (
42+
stepPrefix={idx => (
4343
<span className="font-semibold">Step {idx + 1}:</span>
4444
)}
4545
/>

docusaurus/src/components/MikrotikNetworking/FirewallLogic/index.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@ const FirewallLogic = () => (
1010
>
1111
<Accordion
1212
items={firewallConfigData.steps}
13-
getTitle={(item) => item.title}
14-
renderContent={(item) => (
13+
getTitle={item => item.title}
14+
renderContent={item => (
1515
<>
16-
<p className="text-sm mb-4">{item.description}</p>
16+
<p className="mb-4">{item.description}</p>
1717
<CodeBlock code={item.code} />
1818
</>
1919
)}
20-
stepPrefix={(idx) => (
21-
<span className="font-semibold">Step {idx + 1}:</span>
22-
)}
20+
stepPrefix={idx => <span className="font-semibold">Step {idx + 1}:</span>}
2321
/>
2422
</Section>
2523
);

0 commit comments

Comments
 (0)