import type { ReactNode } from "react";
import {
siApple,
siDocker,
siGitea,
siGodaddy,
siHarbor,
siKubernetes,
siNginx,
} from "simple-icons";
import { BarChart3, Globe, Laptop, Rocket } from "lucide-react";
import { BrandIcon } from "@/components/BrandIcon";
import { Boundary, Connector, FlowNode } from "@/components/flow";
type Target = {
name: string;
detail: string;
icon: ReactNode;
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: ,
accent: `#${siHarbor.hex}`,
},
{
name: "gitea",
detail: "gitea.tomchien.com:3001",
icon: ,
accent: `#${siGitea.hex}`,
},
];
/** Applications running in the cluster, reached through ingress-nginx. */
const targets: Target[] = [
{
name: "it-cost-dev",
detail: "dev environment",
icon: ,
accent: "#fcd34d",
},
{
name: "it-cost-prod",
detail: "it-cost-prod.tomchien.com",
icon: ,
accent: "#6ee7b7",
},
{
name: "portal",
detail: "tomchien.com · this site",
icon: ,
accent: "#7dd3fc",
},
];
function TargetCard({ t }: { t: Target }) {
return (
{t.icon}
{t.name}
{t.detail}
);
}
export function RequestFlow() {
return (
}>
}
title="Visitor"
subtitle="Opens a hostname in the browser."
detail="*.tomchien.com"
className="w-full lg:max-w-xs"
/>
}
title="GoDaddy DNS"
subtitle="Records for tomchien.com point every hostname at the lab."
detail="host.tomchien.com → Mac mini"
className="w-full lg:max-w-xs"
/>
}
>
{/* 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. */}
}
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:w-60 lg:flex-none"
/>
}
tone="border-sky-400/40"
className="min-w-0 flex-1"
>
}
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"
/>
5
Service → Pod
{targets.map((t) => (
-
))}
LoadBalancer Service → Pod · own ports, not behind ingress-nginx
{loadBalanced.map((t) => (
-
))}
);
}