Files
project-infra/presentation/diagrams/registry-push-flow.drawio
T

114 lines
11 KiB
Plaintext

<mxfile host="app.diagrams.net">
<diagram name="Registry Push" id="push-flow">
<mxGraphModel dx="1422" dy="800" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1600" pageHeight="1000" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="title" value="Registry Push 흐름 — 왜 docker push 가 깨졌고, 왜 OCI tar + HTTP API 가 통했나" style="text;html=1;align=center;verticalAlign=middle;fontSize=22;fontStyle=1;fontColor=#1f1f1f" vertex="1" parent="1">
<mxGeometry x="100" y="20" width="1400" height="40" as="geometry" />
</mxCell>
<mxCell id="left-bg" value="" style="rounded=0;fillColor=#fff5f5;strokeColor=#cc0000;strokeWidth=2;dashed=1;opacity=70" vertex="1" parent="1">
<mxGeometry x="40" y="80" width="740" height="880" as="geometry" />
</mxCell>
<mxCell id="left-header" value="❌ 시나리오 A — docker push via kubectl port-forward" style="text;align=center;fontSize=18;fontStyle=1;fontColor=#cc0000;verticalAlign=middle" vertex="1" parent="1">
<mxGeometry x="60" y="95" width="700" height="36" as="geometry" />
</mxCell>
<mxCell id="a1" value="① Developer PC&#10;&#10;docker push localhost:5000/auth-platform/auth-server:..." style="rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=14;fontStyle=1;verticalAlign=middle;align=center;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="240" y="160" width="380" height="70" as="geometry" />
</mxCell>
<mxCell id="a2" value="② kubectl port-forward&#10;svc/docker-registry 5000:5000&#10;&#10;사용자 PC ↔ K8s API server ↔ Pod 의 SPDY tunnel" style="rounded=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=13;verticalAlign=middle;align=center;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="240" y="270" width="380" height="100" as="geometry" />
</mxCell>
<mxCell id="a2-warn" value="⚠ 함정 1&#10;&#10;docker push 는 layer 별로&#10;여러 stream 동시 업로드&#10;&#10;port-forward 의 SPDY 는&#10;긴 다중 stream 안정 보장 X&#10;&#10;BuildKit 도 일부 동작에서&#10;https://localhost:5000 시도&#10;→ TLS handshake 실패&#10;&#10;→ connection reset /&#10;stream timeout 반복" style="rounded=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=12;verticalAlign=middle;align=left;spacingLeft=8;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="60" y="250" width="170" height="240" as="geometry" />
</mxCell>
<mxCell id="a3" value="③ Registry Pod (mnt namespace)&#10;&#10;blob 받음 → S3 driver 가 MinIO 로 redirect 응답" style="rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=13;verticalAlign=middle;align=center;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="240" y="410" width="380" height="80" as="geometry" />
</mxCell>
<mxCell id="a4" value="④ 302 Redirect&#10;&#10;Location: https://minio.mnt.svc.cluster.local/...&#10;?X-Amz-Signature=..." style="rounded=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;verticalAlign=middle;align=center;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="240" y="530" width="380" height="80" as="geometry" />
</mxCell>
<mxCell id="a4-warn" value="⚠ 함정 2&#10;&#10;S3 storage driver 가&#10;client 부담 분산 위해&#10;backend 로 redirect 하는&#10;default 동작&#10;&#10;그러나 redirect URL 의 host 는&#10;cluster 내부 DNS&#10;&#10;외부 client (Dev PC) 는&#10;호스트 해석 자체 불가" style="rounded=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=11;verticalAlign=middle;align=left;spacingLeft=8;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="630" y="410" width="140" height="240" as="geometry" />
</mxCell>
<mxCell id="a5" value="⑤ Developer PC&#10;&#10;❌ minio.mnt.svc.cluster.local 호스트 미해석&#10;blob 업로드 도달 실패" style="rounded=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=13;fontStyle=1;verticalAlign=middle;align=center;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="240" y="650" width="380" height="80" as="geometry" />
</mxCell>
<mxCell id="a-result" value="결과&#10;&#10;write: connection reset by peer&#10;error creating error stream: Timeout&#10;반복 retry · 끝나지 않음" style="rounded=1;fillColor=#f8cecc;strokeColor=#cc0000;strokeWidth=3;fontSize=13;fontStyle=1;verticalAlign=middle;align=center;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="180" y="780" width="500" height="80" as="geometry" />
</mxCell>
<mxCell id="a-arrow-1" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#666666" edge="1" parent="1" source="a1" target="a2"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="a-arrow-2" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#666666" edge="1" parent="1" source="a2" target="a3"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="a-arrow-3" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#666666" edge="1" parent="1" source="a3" target="a4"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="a-arrow-4" style="endArrow=classic;html=1;strokeWidth=3;strokeColor=#cc0000;dashed=1" edge="1" parent="1" source="a4" target="a5"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="a-arrow-5" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#cc0000" edge="1" parent="1" source="a5" target="a-result"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="right-bg" value="" style="rounded=0;fillColor=#f5fff5;strokeColor=#00aa00;strokeWidth=2;dashed=1;opacity=70" vertex="1" parent="1">
<mxGeometry x="820" y="80" width="740" height="880" as="geometry" />
</mxCell>
<mxCell id="right-header" value="✅ 시나리오 B — BuildX OCI tar + HTTP API 순차 push" style="text;align=center;fontSize=18;fontStyle=1;fontColor=#006600;verticalAlign=middle" vertex="1" parent="1">
<mxGeometry x="840" y="95" width="700" height="36" as="geometry" />
</mxCell>
<mxCell id="b1" value="① Developer PC&#10;&#10;docker buildx build --output type=oci,dest=/tmp/img.tar" style="rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=14;fontStyle=1;verticalAlign=middle;align=center;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="1020" y="160" width="380" height="70" as="geometry" />
</mxCell>
<mxCell id="b2" value="② OCI tar 내부 구조&#10;&#10;manifest.json + config.json + N개의 layer blob" style="rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=13;verticalAlign=middle;align=center;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="1020" y="270" width="380" height="70" as="geometry" />
</mxCell>
<mxCell id="b3" value="③ curl PUT — 한 번에 1 blob, 1 stream&#10;&#10;순차: blob1 → blob2 → ... → manifest" style="rounded=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=13;verticalAlign=middle;align=center;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="1020" y="380" width="380" height="80" as="geometry" />
</mxCell>
<mxCell id="b3-note" value="✓ 우회 1&#10;&#10;single-stream 이라&#10;port-forward 의 SPDY 도&#10;안정적으로 유지됨&#10;&#10;docker daemon 의&#10;multi-blob 병렬 push&#10;흐름 자체를 안 씀" style="rounded=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=11;verticalAlign=middle;align=left;spacingLeft=8;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="1430" y="380" width="130" height="160" as="geometry" />
</mxCell>
<mxCell id="b4" value="④ Traefik Ingress&#10;(registry.project.com, HTTP 80)&#10;&#10;BasicAuth middleware 통과 (&lt;registry-user&gt;)" style="rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=13;verticalAlign=middle;align=center;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="1020" y="500" width="380" height="80" as="geometry" />
</mxCell>
<mxCell id="b5" value="⑤ Registry Pod&#10;&#10;REGISTRY_STORAGE_REDIRECT_DISABLE=true&#10;Registry 가 직접 MinIO 와 통신 후 응답에 데이터 전달" style="rounded=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=13;fontStyle=1;verticalAlign=middle;align=center;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="1020" y="620" width="380" height="100" as="geometry" />
</mxCell>
<mxCell id="b5-note" value="✓ 우회 2&#10;&#10;redirect 끄면&#10;client 는 MinIO 의&#10;cluster-internal URL 을&#10;아예 받지 않음&#10;&#10;Registry 한 곳만&#10;도달하면 push 완료" style="rounded=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=11;verticalAlign=middle;align=left;spacingLeft=8;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="1430" y="620" width="130" height="160" as="geometry" />
</mxCell>
<mxCell id="b6" value="⑥ MinIO (cluster 내부)&#10;&#10;Registry 가 read/write — client 와 직접 접점 없음" style="rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=13;verticalAlign=middle;align=center;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="1020" y="760" width="380" height="80" as="geometry" />
</mxCell>
<mxCell id="b-result" value="결과&#10;&#10;blob+manifest 정상 업로드&#10;/v2/auth-platform/auth-server/tags/list 에서 새 태그 확인됨" style="rounded=1;fillColor=#d5e8d4;strokeColor=#006600;strokeWidth=3;fontSize=13;fontStyle=1;verticalAlign=middle;align=center;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="970" y="870" width="480" height="80" as="geometry" />
</mxCell>
<mxCell id="b-arrow-1" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#666666" edge="1" parent="1" source="b1" target="b2"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="b-arrow-2" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#666666" edge="1" parent="1" source="b2" target="b3"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="b-arrow-3" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#666666" edge="1" parent="1" source="b3" target="b4"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="b-arrow-4" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#666666" edge="1" parent="1" source="b4" target="b5"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="b-arrow-5" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#666666" edge="1" parent="1" source="b5" target="b6"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="b-arrow-6" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#006600" edge="1" parent="1" source="b6" target="b-result"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="legend" value="🟦 정상 컴포넌트 🟨 주의 지점 🟩 해결 / 안전 경로 🟥 실패 / 차단 ⚠ 함정 박스 ✓ 우회 효과" style="rounded=1;fillColor=#fafafa;strokeColor=#999999;fontSize=13;verticalAlign=middle;align=center;whiteSpace=wrap;html=1" vertex="1" parent="1">
<mxGeometry x="160" y="970" width="1280" height="24" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>