This commit is contained in:
+54
-73
@@ -1,82 +1,63 @@
|
||||
import { siDocker, siGit, siGitea, siHarbor, siHelm, siKubernetes } from "simple-icons";
|
||||
import { GitBranch } from "lucide-react";
|
||||
import { BrandIcon } from "@/components/BrandIcon";
|
||||
import { Connector, FlowNode } from "@/components/flow";
|
||||
|
||||
const guarantees = [
|
||||
{ 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}
|
||||
accent={`#${siGit.hex}`}
|
||||
icon={<BrandIcon icon={siGit} className="size-5" />}
|
||||
title="git push"
|
||||
subtitle="A branch or tag push starts the pipeline."
|
||||
detail="dev | v1.2.3"
|
||||
/>
|
||||
<Connector color="#34d399" />
|
||||
<FlowNode
|
||||
step={2}
|
||||
accent={`#${siGitea.hex}`}
|
||||
icon={<BrandIcon icon={siGitea} className="size-5" />}
|
||||
title="Gitea Actions"
|
||||
subtitle="act_runner picks up the workflow from the repo."
|
||||
detail="cicd.yaml"
|
||||
/>
|
||||
<Connector color="#34d399" />
|
||||
<FlowNode
|
||||
step={3}
|
||||
accent={`#${siDocker.hex}`}
|
||||
icon={<BrandIcon icon={siDocker} className="size-5" />}
|
||||
title="docker build"
|
||||
subtitle="Runner pod uses the Docker Desktop daemon socket."
|
||||
detail="multi-stage Dockerfile"
|
||||
/>
|
||||
<Connector color="#34d399" />
|
||||
<FlowNode
|
||||
step={4}
|
||||
accent={`#${siHarbor.hex}`}
|
||||
icon={<BrandIcon icon={siHarbor} className="size-5" />}
|
||||
title="Harbor"
|
||||
subtitle="Image is pushed to the private registry."
|
||||
detail="registry :8080"
|
||||
/>
|
||||
<Connector color="#34d399" />
|
||||
<FlowNode
|
||||
step={5}
|
||||
accent="#7c8cff"
|
||||
icon={<BrandIcon icon={siHelm} color="#7c8cff" className="size-5" />}
|
||||
title="helm upgrade"
|
||||
subtitle="Chart is rolled out to the namespace."
|
||||
detail="--atomic"
|
||||
/>
|
||||
<Connector color="#34d399" />
|
||||
<FlowNode
|
||||
step={6}
|
||||
accent={`#${siKubernetes.hex}`}
|
||||
icon={<BrandIcon icon={siKubernetes} className="size-5" />}
|
||||
title="Kubernetes"
|
||||
subtitle="Pods pull from Harbor with a pull secret."
|
||||
detail="Deployment · Service · Ingress"
|
||||
/>
|
||||
</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 className="flex flex-col items-stretch lg:flex-row lg:items-stretch">
|
||||
<FlowNode
|
||||
step={1}
|
||||
accent={`#${siGit.hex}`}
|
||||
icon={<BrandIcon icon={siGit} className="size-5" />}
|
||||
title="git push"
|
||||
subtitle="A branch or tag push starts the pipeline."
|
||||
detail="dev | v1.2.3"
|
||||
/>
|
||||
<Connector color="#34d399" />
|
||||
<FlowNode
|
||||
step={2}
|
||||
accent={`#${siGitea.hex}`}
|
||||
icon={<BrandIcon icon={siGitea} className="size-5" />}
|
||||
title="Gitea Actions"
|
||||
subtitle="act_runner picks up the workflow from the repo."
|
||||
detail="cicd.yaml"
|
||||
/>
|
||||
<Connector color="#34d399" />
|
||||
<FlowNode
|
||||
step={3}
|
||||
accent={`#${siDocker.hex}`}
|
||||
icon={<BrandIcon icon={siDocker} className="size-5" />}
|
||||
title="docker build"
|
||||
subtitle="Runner pod uses the Docker Desktop daemon socket."
|
||||
detail="multi-stage Dockerfile"
|
||||
/>
|
||||
<Connector color="#34d399" />
|
||||
<FlowNode
|
||||
step={4}
|
||||
accent={`#${siHarbor.hex}`}
|
||||
icon={<BrandIcon icon={siHarbor} className="size-5" />}
|
||||
title="Harbor"
|
||||
subtitle="Image is pushed to the private registry."
|
||||
detail="registry :8080"
|
||||
/>
|
||||
<Connector color="#34d399" />
|
||||
<FlowNode
|
||||
step={5}
|
||||
accent="#7c8cff"
|
||||
icon={<BrandIcon icon={siHelm} color="#7c8cff" className="size-5" />}
|
||||
title="helm upgrade"
|
||||
subtitle="Chart is rolled out to the namespace."
|
||||
detail="--atomic"
|
||||
/>
|
||||
<Connector color="#34d399" />
|
||||
<FlowNode
|
||||
step={6}
|
||||
accent={`#${siKubernetes.hex}`}
|
||||
icon={<BrandIcon icon={siKubernetes} className="size-5" />}
|
||||
title="Kubernetes"
|
||||
subtitle="Pods pull from Harbor with a pull secret."
|
||||
detail="Deployment · Service · Ingress"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -19,8 +19,11 @@ type Target = {
|
||||
accent: string;
|
||||
};
|
||||
|
||||
/** Reached on their own host ports; they sit beside the cluster, not behind it. */
|
||||
const direct: Target[] = [
|
||||
/**
|
||||
* 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",
|
||||
@@ -109,8 +112,11 @@ export function RequestFlow() {
|
||||
label="Mac mini · macOS host"
|
||||
icon={<BrandIcon icon={siApple} color="#e2e8f0" className="size-3.5" />}
|
||||
>
|
||||
<div className="space-y-6">
|
||||
<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}`}
|
||||
@@ -118,16 +124,18 @@ export function RequestFlow() {
|
||||
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"
|
||||
className="lg:w-60 lg:flex-none"
|
||||
/>
|
||||
<Connector label="proxy_pass" />
|
||||
</div>
|
||||
|
||||
<Boundary
|
||||
label="Docker Desktop · Kubernetes"
|
||||
icon={<BrandIcon icon={siDocker} className="size-3.5" />}
|
||||
tone="border-sky-400/40"
|
||||
className="min-w-0 flex-1"
|
||||
>
|
||||
<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="space-y-6">
|
||||
<div className="flex flex-col items-stretch lg:flex-row lg:items-center">
|
||||
<FlowNode
|
||||
step={4}
|
||||
@@ -158,21 +166,21 @@ export function RequestFlow() {
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</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 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>
|
||||
</div>
|
||||
</div>
|
||||
</Boundary>
|
||||
</div>
|
||||
</Boundary>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user