revise
CI/CD (dev on branch, prod on tag) / build-and-deploy (push) Successful in 3m27s

This commit is contained in:
Tom Chien (IQ-AS)
2026-11-18 18:11:03 +08:00
parent 1988c635fe
commit b554c90e03
10 changed files with 136 additions and 291 deletions
+96 -70
View File
@@ -19,6 +19,23 @@ type Target = {
accent: string;
};
/** Reached on their own host ports; they sit beside the cluster, not behind it. */
const direct: 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 +49,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 +57,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,73 +102,77 @@ 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">
<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."
detail="listen :80 → 127.0.0.1:8081"
className="lg:max-w-60"
/>
<Connector label=":80 → :8081" />
<div className="space-y-6">
<div className="flex flex-col items-stretch 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: takes port 80 and forwards it to the cluster ingress."
detail="listen :80 → 127.0.0.1:8081"
className="lg:max-w-60"
/>
<Connector label="proxy_pass" />
<Boundary
label="Docker Desktop · Kubernetes"
icon={<BrandIcon icon={siDocker} className="size-3.5" />}
tone="border-sky-400/40"
className="min-w-0 flex-1"
>
<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."
detail="127.0.0.1 : 8081"
className="lg:max-w-56"
/>
<Connector label="Host rule" />
<div className="min-w-0 flex-1">
<p className="mb-2 flex items-center gap-2 text-xs font-medium tracking-wide text-slate-400 uppercase">
<span className="rounded bg-sky-400/15 px-1.5 py-0.5 text-[10px] font-semibold text-sky-300">
5
</span>
Service → Pod
</p>
<ul className="relative space-y-2 border-l border-sky-400/30 pl-4">
{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"
>
<span
className="flex size-8 flex-none items-center justify-center rounded-md border"
style={{ backgroundColor: `${t.accent}1f`, borderColor: `${t.accent}40` }}
<Boundary
label="Docker Desktop · Kubernetes"
icon={<BrandIcon icon={siDocker} className="size-3.5" />}
tone="border-sky-400/40"
className="min-w-0 flex-1"
>
<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 each application hostname by its Host header."
detail="127.0.0.1 : 8081"
className="lg:max-w-56"
/>
<Connector label="Host rule" />
<div className="min-w-0 flex-1">
<p className="mb-2 flex items-center gap-2 text-xs font-medium tracking-wide text-slate-400 uppercase">
<span className="rounded bg-sky-400/15 px-1.5 py-0.5 text-[10px] font-semibold text-sky-300">
5
</span>
Service → Pod
</p>
<ul className="relative space-y-2 border-l border-sky-400/30 pl-4">
{targets.map((t) => (
<li
key={t.name}
className="relative before:absolute before:top-1/2 before:-left-4 before:h-px before:w-4 before:bg-sky-400/30"
>
{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>
</li>
))}
</ul>
<TargetCard t={t} />
</li>
))}
</ul>
</div>
</div>
</div>
</Boundary>
</Boundary>
</div>
<div>
<p className="mb-2 text-xs font-medium tracking-wide text-slate-400 uppercase">
Direct on their own ports · not behind ingress-nginx
</p>
<ul className="grid gap-2 sm:grid-cols-2">
{direct.map((t) => (
<li key={t.name}>
<TargetCard t={t} />
</li>
))}
</ul>
</div>
</div>
</Boundary>
</div>