6 Commits
Author SHA1 Message Date
Tom Chien (IQ-AS) ef3ab9255d add email 02
CI/CD (dev on branch, prod on tag) / build-and-deploy (push) Successful in 4m54s
2026-11-19 16:16:43 +08:00
Tom Chien (IQ-AS) a3d3884451 add email 01
CI/CD (dev on branch, prod on tag) / build-and-deploy (push) Successful in 9m8s
2026-11-19 15:55:05 +08:00
Tom Chien (IQ-AS) b084978ac4 add email
CI/CD (dev on branch, prod on tag) / build-and-deploy (push) Successful in 8m25s
2026-11-19 15:39:57 +08:00
Tom Chien (IQ-AS) 2553f3806d revise prod url
CI/CD (dev on branch, prod on tag) / build-and-deploy (push) Successful in 5m51s
2026-11-19 15:18:49 +08:00
Tom Chien (IQ-AS) 5fe2ecd757 upload
CI/CD (dev on branch, prod on tag) / build-and-deploy (push) Successful in 4m7s
2026-11-18 18:41:41 +08:00
Tom Chien (IQ-AS) b554c90e03 revise
CI/CD (dev on branch, prod on tag) / build-and-deploy (push) Successful in 3m27s
2026-11-18 18:11:03 +08:00
12 changed files with 221 additions and 360 deletions
+5 -5
View File
@@ -1,10 +1,11 @@
# Portal
Interview portal for my Kubernetes home lab. A single-page Next.js site with three sections:
Interview portal for my Kubernetes home lab. A single-page Next.js site with two sections:
1. **Introduction** - short bio (placeholder `TBD` until the ~200 words are written).
2. **The Lab** - animated diagrams of the request path (GoDaddy DNS -> host Nginx :80 -> ingress-nginx :8081 -> Service -> Pod) and the CI/CD pipeline (git push -> Gitea Actions -> docker build -> Harbor -> Helm -> Kubernetes), plus a link list for `it-cost-prod`, `harbor` and `gitea`.
3. **Travel** - link to the travel map.
1. **The Lab** - diagrams of the request path and the CI/CD pipeline, plus a link list for `it-cost-prod`, `harbor` and `gitea`.
- Request path: GoDaddy DNS -> host Nginx :80 -> ingress-nginx :8081 -> Service -> Pod for the applications. `harbor` (`:8080`) and `gitea` (`:3001`) are pods in the same cluster, but each is exposed by its own LoadBalancer Service on a host port, so they are not behind ingress-nginx.
- CI/CD: git push -> Gitea Actions -> docker build -> Harbor -> Helm -> Kubernetes.
2. **Travel** - link to the travel map.
Everything is rendered by server components (no client JS), styled with Tailwind CSS 4, and shipped as a Next.js `standalone` build.
@@ -15,7 +16,6 @@ All copy lives in one file: [`content/site.ts`](content/site.ts).
| What | Where |
| --- | --- |
| Name shown in the header | `profile.name` |
| Introduction paragraphs | `introduction` (array of strings, one per paragraph) |
| Lab links, user and password | `labServices` |
| Travel map link, user and password | `travel` |
+1 -1
View File
@@ -5,7 +5,7 @@ import "./globals.css";
export const metadata: Metadata = {
title: `${profile.name} · Portal`,
description:
"Personal portal: an introduction, the architecture and CI/CD workflow of my Kubernetes home lab, and my travel album.",
"Personal portal: the architecture and CI/CD workflow of my Kubernetes home lab, and my travel album.",
};
export default function RootLayout({ children }: LayoutProps<"/">) {
+25 -14
View File
@@ -1,17 +1,26 @@
import { Header } from "@/components/Header";
import { Introduction } from "@/components/Introduction";
import { Section } from "@/components/Section";
import { Travel } from "@/components/Travel";
import { CicdFlow } from "@/components/lab/CicdFlow";
import { RequestFlow } from "@/components/lab/RequestFlow";
import { ServiceLinks } from "@/components/lab/ServiceLinks";
import { StackBadges } from "@/components/lab/StackBadges";
import { profile } from "@/content/site";
function SubHeading({ title, children }: { title: string; children?: React.ReactNode }) {
function SubHeading({
title,
children,
}: {
title: string;
children?: React.ReactNode;
}) {
return (
<div className="mb-8">
<h3 className="text-xl font-semibold text-white">{title}</h3>
{children && <p className="mt-1 max-w-3xl text-sm leading-6 text-slate-400">{children}</p>}
{children && (
<p className="mt-1 max-w-3xl text-sm leading-6 text-slate-400">
{children}
</p>
)}
</div>
);
}
@@ -22,28 +31,30 @@ export default function Home() {
<span id="top" />
<Header />
<main className="flex-1">
<Introduction />
<h1 className="sr-only">{profile.name}: Kubernetes lab portal</h1>
<Section
id="lab"
eyebrow="The Lab"
title="A Kubernetes lab on a Mac mini"
lead="Kubernetes comes from Docker Desktop on my Mac mini. A host-level Nginx accepts traffic on port 80 and hands it to the cluster's ingress controller, which routes each hostname to the right service. Everything below is hosted on that one machine, including this site."
title="A Self-Hosted CI/CD and Kubernetes lab on a Mac mini"
lead="Kubernetes comes from Docker Desktop on my Mac mini in my home lab. A host-level Nginx accepts traffic on port 80 and hands it to the cluster's ingress controller, which routes each application hostname to the right service. Harbor and Gitea run in the same cluster, but each is exposed by its own LoadBalancer service on a host port, so they skip the ingress. Everything below is hosted on that one machine, including this site."
>
<StackBadges />
<div className="mt-14">
<div>
<SubHeading title="How a request reaches a pod">
DNS is managed at GoDaddy. From there a request passes through the host Nginx and
the cluster ingress before landing on a pod.
DNS is managed at GoDaddy. Application traffic passes through the
host Nginx and the cluster ingress before landing on a pod. Harbor
and Gitea are pods in the cluster too, but each is exposed by its
own LoadBalancer service on :8080 and :3001, so they are not
behind the ingress.
</SubHeading>
<RequestFlow />
</div>
<div className="mt-20">
<SubHeading title="From git push to running pod">
Gitea Actions builds the image on the Docker Desktop daemon, stores it in Harbor and
deploys it with Helm. A branch push goes to dev, a tag goes to prod.
Gitea Actions builds the image on the Docker Desktop daemon,
stores it in Harbor and deploys it with Helm. A branch push goes
to dev, a tag goes to prod.
</SubHeading>
<CicdFlow />
</div>
+6 -1
View File
@@ -1,7 +1,6 @@
import { profile } from "@/content/site";
const links = [
{ href: "#introduction", label: "Introduction" },
{ href: "#lab", label: "The Lab" },
{ href: "#travel", label: "Travel" },
];
@@ -22,7 +21,13 @@ export function Header() {
<span className="flex size-7 items-center justify-center rounded-md bg-linear-to-br from-sky-400 to-indigo-500 text-xs font-bold text-slate-950">
{initials}
</span>
<div className="hidden sm:flex sm:items-center sm:gap-2">
<span className="sr-only sm:not-sr-only">{profile.name}</span>
<span className="text-slate-600">•</span>
<span className="text-xs font-normal text-slate-400">
{profile.email}
</span>
</div>
</a>
<nav aria-label="Primary">
<ul className="flex items-center gap-1 text-sm">
-24
View File
@@ -1,24 +0,0 @@
import { introduction, profile } from "@/content/site";
export function Introduction() {
return (
<section id="introduction" className="scroll-mt-16 pt-20 pb-16 sm:pt-28 sm:pb-24">
<div className="mx-auto w-full max-w-6xl px-6">
<p className="text-sm font-semibold tracking-widest text-sky-400 uppercase">
Introduction
</p>
<h1 className="mt-3 text-4xl font-bold tracking-tight text-white sm:text-6xl">
Hi, I&apos;m{" "}
<span className="bg-linear-to-r from-sky-300 to-indigo-400 bg-clip-text text-transparent">
{profile.name}
</span>
</h1>
<div className="mt-8 max-w-3xl space-y-5 text-lg leading-8 text-slate-300">
{introduction.map((p, i) => (
<p key={i}>{p}</p>
))}
</div>
</div>
</section>
);
}
+7 -1
View File
@@ -5,16 +5,22 @@ export function Section({
eyebrow,
title,
lead,
compactTop = false,
children,
}: {
id: string;
eyebrow: string;
title: string;
lead?: ReactNode;
/** Trim the top padding when the section follows another one, so the gap between them isn't doubled. */
compactTop?: boolean;
children: ReactNode;
}) {
return (
<section id={id} className="scroll-mt-16 py-16 sm:py-24">
<section
id={id}
className={`scroll-mt-16 pb-16 sm:pb-24 ${compactTop ? "pt-2 sm:pt-4" : "pt-16 sm:pt-24"}`}
>
<div className="mx-auto w-full max-w-6xl px-6">
<p className="text-sm font-semibold tracking-widest text-sky-400 uppercase">
{eyebrow}
+3 -58
View File
@@ -1,71 +1,18 @@
import { ExternalLink, MapPin, Plane } from "lucide-react";
import { ExternalLink, MapPin } from "lucide-react";
import { CredentialRows } from "@/components/CredentialRows";
import { Section } from "@/components/Section";
import { travel } from "@/content/site";
/** Decorative route map: dotted "world" backdrop, a dashed flight path and pins. */
function RouteArt() {
const pins = [
{ x: 70, y: 150 },
{ x: 170, y: 70 },
{ x: 290, y: 120 },
{ x: 400, y: 50 },
];
return (
<svg
viewBox="0 0 470 200"
role="img"
aria-label="Illustration of a travel route connecting four destinations"
className="h-full w-full"
>
<defs>
<pattern id="dots" width="14" height="14" patternUnits="userSpaceOnUse">
<circle cx="2" cy="2" r="1.2" fill="#38bdf8" fillOpacity="0.28" />
</pattern>
<linearGradient id="route" x1="0" x2="1">
<stop offset="0" stopColor="#38bdf8" />
<stop offset="1" stopColor="#818cf8" />
</linearGradient>
</defs>
<rect width="470" height="200" fill="url(#dots)" />
<path
d="M70 150 C 100 60, 140 40, 170 70 S 250 160, 290 120 S 370 20, 400 50"
fill="none"
stroke="url(#route)"
strokeWidth="2.5"
strokeDasharray="6 7"
strokeLinecap="round"
/>
{pins.map((p, i) => (
<g key={i} transform={`translate(${p.x} ${p.y})`}>
<circle r="11" fill="#38bdf8" fillOpacity="0.18" />
<circle r="5" fill={i === pins.length - 1 ? "#818cf8" : "#38bdf8"} />
<circle r="5" fill="none" stroke="#fff" strokeOpacity="0.8" strokeWidth="1.5" />
</g>
))}
</svg>
);
}
export function Travel() {
return (
<Section
id="travel"
compactTop
eyebrow="Beyond the terminal"
title="Get to know me through my travel album"
lead="Outside of work I like to explore. Pin by pin, the travel map is a visual diary of the places I have been."
>
<div className="overflow-hidden rounded-2xl border border-white/10 bg-slate-900/70 shadow-lg shadow-black/20">
<div className="grid lg:grid-cols-2">
<div className="relative min-h-52 border-b border-white/10 bg-linear-to-br from-sky-500/10 via-transparent to-indigo-500/10 p-4 lg:border-r lg:border-b-0">
<RouteArt />
<span className="absolute top-4 left-4 flex items-center gap-1.5 rounded-full border border-white/15 bg-slate-950/80 px-3 py-1 text-xs text-slate-200">
<Plane className="size-3.5 text-sky-300" aria-hidden="true" />
Travel map
</span>
</div>
<div className="flex flex-col justify-center gap-5 p-6 sm:p-8">
<div className="flex max-w-2xl flex-col gap-5 rounded-2xl border border-white/10 bg-slate-900/70 p-6 shadow-lg shadow-black/20 sm:p-8">
<div>
<h3 className="flex items-center gap-2 text-xl font-semibold text-white">
<MapPin className="size-5 text-sky-300" aria-hidden="true" />
@@ -86,8 +33,6 @@ export function Travel() {
</a>
<CredentialRows user={travel.user} password={travel.password} />
</div>
</div>
</div>
</Section>
);
}
-76
View File
@@ -1,43 +1,9 @@
import { siDocker, siGit, siGitea, siHarbor, siHelm, siKubernetes } from "simple-icons";
import { GitBranch, ShieldCheck, Tag, Undo2 } from "lucide-react";
import { BrandIcon } from "@/components/BrandIcon";
import { Connector, FlowNode } from "@/components/flow";
const lanes = [
{
env: "DEV",
badge: "border-amber-300/40 bg-amber-300/10 text-amber-200",
ring: "border-amber-300/25",
icon: <GitBranch className="size-4 text-amber-300" aria-hidden="true" />,
trigger: "Push to branch dev",
rows: [
["Image tag", "<commit sha> · latest-dev"],
["Release", "<app>-dev, own namespace"],
],
},
{
env: "PROD",
badge: "border-emerald-300/40 bg-emerald-300/10 text-emerald-200",
ring: "border-emerald-300/25",
icon: <Tag className="size-4 text-emerald-300" aria-hidden="true" />,
trigger: "Push a version tag",
rows: [
["Guard", "tag commit must be on main"],
["Image tag", "<release tag> · latest-prod"],
["Release", "<app>-prod, own namespace"],
],
},
];
const guarantees = [
{ icon: <ShieldCheck className="size-4" aria-hidden="true" />, text: "Immutable image tags" },
{ icon: <Undo2 className="size-4" aria-hidden="true" />, text: "helm --atomic --wait rolls back a bad release" },
{ icon: <GitBranch className="size-4" aria-hidden="true" />, text: "One pipeline, two environments" },
];
export function CicdFlow() {
return (
<div>
<div className="flex flex-col items-stretch lg:flex-row lg:items-stretch">
<FlowNode
step={1}
@@ -93,47 +59,5 @@ export function CicdFlow() {
detail="Deployment · Service · Ingress"
/>
</div>
<div className="mt-8 grid gap-4 md:grid-cols-2">
{lanes.map((lane) => (
<div
key={lane.env}
className={`rounded-xl border bg-slate-900/60 p-5 ${lane.ring}`}
>
<div className="flex items-center gap-3">
<span
className={`rounded-md border px-2 py-0.5 text-xs font-bold tracking-wider ${lane.badge}`}
>
{lane.env}
</span>
<span className="flex items-center gap-1.5 text-sm font-medium text-white">
{lane.icon}
{lane.trigger}
</span>
</div>
<dl className="mt-4 space-y-2 text-sm">
{lane.rows.map(([k, v]) => (
<div key={k} className="flex flex-wrap items-baseline justify-between gap-x-4">
<dt className="text-slate-400">{k}</dt>
<dd className="font-mono text-xs text-slate-200">{v}</dd>
</div>
))}
</dl>
</div>
))}
</div>
<ul className="mt-6 flex flex-wrap gap-2">
{guarantees.map((g) => (
<li
key={g.text}
className="flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-3 py-1.5 text-xs text-slate-300"
>
<span className="text-emerald-300">{g.icon}</span>
{g.text}
</li>
))}
</ul>
</div>
);
}
+65 -31
View File
@@ -19,6 +19,26 @@ type Target = {
accent: string;
};
/**
* Pods in the cluster that are exposed by their own LoadBalancer Service on a
* host port, so they bypass ingress-nginx.
*/
const loadBalanced: Target[] = [
{
name: "harbor",
detail: "harbor.tomchien.com:8080",
icon: <BrandIcon icon={siHarbor} className="size-5" />,
accent: `#${siHarbor.hex}`,
},
{
name: "gitea",
detail: "gitea.tomchien.com:3001",
icon: <BrandIcon icon={siGitea} className="size-5" />,
accent: `#${siGitea.hex}`,
},
];
/** Applications running in the cluster, reached through ingress-nginx. */
const targets: Target[] = [
{
name: "it-cost-dev",
@@ -32,18 +52,6 @@ const targets: Target[] = [
icon: <BarChart3 className="size-5 text-emerald-300" aria-hidden="true" />,
accent: "#6ee7b7",
},
{
name: "harbor",
detail: "harbor.tomchien.com",
icon: <BrandIcon icon={siHarbor} className="size-5" />,
accent: `#${siHarbor.hex}`,
},
{
name: "gitea",
detail: "gitea.tomchien.com",
icon: <BrandIcon icon={siGitea} className="size-5" />,
accent: `#${siGitea.hex}`,
},
{
name: "portal",
detail: "tomchien.com · this site",
@@ -52,6 +60,23 @@ const targets: Target[] = [
},
];
function TargetCard({ t }: { t: Target }) {
return (
<div className="flex items-center gap-3 rounded-lg border border-white/10 bg-slate-900/70 px-3 py-2">
<span
className="flex size-8 flex-none items-center justify-center rounded-md border"
style={{ backgroundColor: `${t.accent}1f`, borderColor: `${t.accent}40` }}
>
{t.icon}
</span>
<span className="min-w-0 flex-1">
<span className="block text-sm font-semibold text-white">{t.name}</span>
<span className="block truncate font-mono text-[11px] text-slate-400">{t.detail}</span>
</span>
</div>
);
}
export function RequestFlow() {
return (
<div className="space-y-2">
@@ -80,24 +105,29 @@ export function RequestFlow() {
</Boundary>
<div className="flex justify-center">
<Connector vertical label="HTTP :80" />
<Connector vertical label="HTTP :80 · :8080 · :3001" />
</div>
<Boundary
label="Mac mini · macOS host"
icon={<BrandIcon icon={siApple} color="#e2e8f0" className="size-3.5" />}
>
<div className="flex flex-col items-stretch lg:flex-row lg:items-center">
<div className="flex flex-col items-stretch lg:flex-row lg:items-start">
{/* lg:mt-9 lines the Nginx node up with the ingress-nginx node (the
first row inside the Docker Desktop boundary), not with the whole
boundary, which is taller because of the LoadBalancer row. */}
<div className="flex flex-col items-stretch lg:mt-9 lg:flex-none lg:flex-row lg:items-center">
<FlowNode
step={3}
accent={`#${siNginx.hex}`}
icon={<BrandIcon icon={siNginx} className="size-5" />}
title="Nginx on the host"
subtitle="Edge reverse proxy: redirects port 80 into the cluster."
subtitle="Edge reverse proxy: takes port 80 and forwards it to the cluster ingress."
detail="listen :80 → 127.0.0.1:8081"
className="lg:max-w-60"
className="lg:w-60 lg:flex-none"
/>
<Connector label=":80 → :8081" />
<Connector label="proxy_pass" />
</div>
<Boundary
label="Docker Desktop · Kubernetes"
@@ -105,13 +135,14 @@ export function RequestFlow() {
tone="border-sky-400/40"
className="min-w-0 flex-1"
>
<div className="space-y-6">
<div className="flex flex-col items-stretch lg:flex-row lg:items-center">
<FlowNode
step={4}
accent={`#${siKubernetes.hex}`}
icon={<BrandIcon icon={siKubernetes} className="size-5" />}
title="ingress-nginx"
subtitle="LoadBalancer on 127.0.0.1. Routes by the Host header."
subtitle="LoadBalancer on 127.0.0.1. Routes each application hostname by its Host header."
detail="127.0.0.1 : 8081"
className="lg:max-w-56"
/>
@@ -127,20 +158,23 @@ export function RequestFlow() {
{targets.map((t) => (
<li
key={t.name}
className="relative flex items-center gap-3 rounded-lg border border-white/10 bg-slate-900/70 px-3 py-2 before:absolute before:top-1/2 before:-left-4 before:h-px before:w-4 before:bg-sky-400/30"
className="relative before:absolute before:top-1/2 before:-left-4 before:h-px before:w-4 before:bg-sky-400/30"
>
<span
className="flex size-8 flex-none items-center justify-center rounded-md border"
style={{ backgroundColor: `${t.accent}1f`, borderColor: `${t.accent}40` }}
>
{t.icon}
</span>
<span className="min-w-0">
<span className="block text-sm font-semibold text-white">{t.name}</span>
<span className="block truncate font-mono text-[11px] text-slate-400">
{t.detail}
</span>
</span>
<TargetCard t={t} />
</li>
))}
</ul>
</div>
</div>
<div className="border-t border-dashed border-sky-400/25 pt-4">
<p className="mb-2 text-xs font-medium tracking-wide text-slate-400 uppercase">
LoadBalancer Service → Pod · own ports, not behind ingress-nginx
</p>
<ul className="grid gap-2 sm:grid-cols-2">
{loadBalanced.map((t) => (
<li key={t.name}>
<TargetCard t={t} />
</li>
))}
</ul>
-39
View File
@@ -1,39 +0,0 @@
import {
siApple,
siDocker,
siGitea,
siGodaddy,
siHarbor,
siHelm,
siKubernetes,
siNginx,
} from "simple-icons";
import type { SimpleIcon } from "simple-icons";
import { BrandIcon } from "@/components/BrandIcon";
const stack: { icon: SimpleIcon; label: string; color?: string }[] = [
{ icon: siApple, label: "Mac mini", color: "#e2e8f0" },
{ icon: siDocker, label: "Docker Desktop" },
{ icon: siKubernetes, label: "Kubernetes" },
{ icon: siNginx, label: "Nginx · ingress-nginx" },
{ icon: siGodaddy, label: "GoDaddy DNS" },
{ icon: siGitea, label: "Gitea Actions" },
{ icon: siHarbor, label: "Harbor" },
{ icon: siHelm, label: "Helm", color: "#7c8cff" },
];
export function StackBadges() {
return (
<ul className="flex flex-wrap gap-2">
{stack.map((s) => (
<li
key={s.label}
className="flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-3 py-1.5 text-sm text-slate-200"
>
<BrandIcon icon={s.icon} color={s.color} className="size-4" />
{s.label}
</li>
))}
</ul>
);
}
+7 -8
View File
@@ -9,11 +9,9 @@ const SCHEME = "http";
export const profile = {
name: "Tom Chien",
email: "s871077@gmail.com",
};
/** One string per paragraph. Replace "TBD" with the ~200 word introduction. */
export const introduction: string[] = ["TBD"];
export type Credentials = { user: string; password: string };
export type LabService = {
@@ -37,9 +35,10 @@ export const labServices: LabService[] = [
{
id: "harbor",
name: "Harbor",
description: "Container registry that stores every image the pipeline builds.",
host: "harbor.tomchien.com",
url: `${SCHEME}://harbor.tomchien.com`,
description:
"Container registry that stores every image the pipeline builds.",
host: "harbor.tomchien.com:8080",
url: `${SCHEME}://harbor.tomchien.com:8080`,
user: "TBD",
password: "TBD",
},
@@ -47,8 +46,8 @@ export const labServices: LabService[] = [
id: "gitea",
name: "Gitea",
description: "Git hosting and Actions CI/CD that drives every deployment.",
host: "gitea.tomchien.com",
url: `${SCHEME}://gitea.tomchien.com`,
host: "gitea.tomchien.com:3001",
url: `${SCHEME}://gitea.tomchien.com:3001`,
user: "TBD",
password: "TBD",
},
+1 -1
View File
@@ -1,6 +1,6 @@
# Prod environment: deployed from a version tag on main.
ingress:
host: tomchien.com
host: portal-prod.tomchien.com
server:
replicas: 1