Files
sless/doc/architecture/sqs-operator-schema.svg
T
Naeel d1d1bffd7c v0.1.13: Strategy Recreate + preStop + liveness fix (ERR-SQS-06 root cause)
- ensureDeployment: Strategy Recreate (not RollingUpdate) — prevents H2 file lock
  when two pods mount same PVC simultaneously during rollout restart
- preStop: sleep 3 — graceful H2 shutdown before SIGTERM
- livenessProbe timeoutSeconds: 3 — prevents false positive on GC pause
- terminationGracePeriodSeconds: 15
- doc: thinking log, ERR-SQS-06, progress.md, architecture SVG schema
2026-04-09 07:49:11 +03:00

136 lines
8.6 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" width="900" height="700" font-family="Arial, sans-serif" font-size="13">
<!-- Background -->
<rect width="900" height="700" fill="#f8f9fa" rx="10"/>
<!-- Title -->
<text x="450" y="32" text-anchor="middle" font-size="18" font-weight="bold" fill="#1a1a2e">SQS Operator — ресурсы на тенанта</text>
<!-- === QueueService CR === -->
<rect x="340" y="55" width="220" height="55" rx="8" fill="#4a90d9" stroke="#2c6fad" stroke-width="1.5"/>
<text x="450" y="77" text-anchor="middle" fill="white" font-weight="bold">📋 QueueService CR</text>
<text x="450" y="97" text-anchor="middle" fill="#dce9f8" font-size="11">tenant: test001 · enableUI: true</text>
<!-- Arrow CR -> Operator -->
<line x1="450" y1="110" x2="450" y2="145" stroke="#666" stroke-width="1.5" marker-end="url(#arr)"/>
<text x="460" y="132" fill="#666" font-size="11">reconcile</text>
<!-- === Operator === -->
<rect x="310" y="145" width="280" height="50" rx="8" fill="#7c3aed" stroke="#5b21b6" stroke-width="1.5"/>
<text x="450" y="166" text-anchor="middle" fill="white" font-weight="bold">⚙️ Оператор</text>
<text x="450" y="184" text-anchor="middle" fill="#e9d5ff" font-size="11">QueueServiceReconciler (Go)</text>
<!-- === Namespace box === -->
<rect x="30" y="235" width="840" height="430" rx="10" fill="white" stroke="#94a3b8" stroke-width="1.5" stroke-dasharray="6,3"/>
<text x="50" y="258" fill="#64748b" font-size="12" font-weight="bold">Namespace: sless-fn-test001</text>
<!-- Arrow Operator -> Namespace -->
<line x1="450" y1="195" x2="450" y2="235" stroke="#666" stroke-width="1.5" marker-end="url(#arr)"/>
<text x="460" y="220" fill="#666" font-size="11">creates</text>
<!-- === Row 1: Secret, ConfigMap, PVC === -->
<!-- Secret -->
<rect x="55" y="270" width="180" height="60" rx="7" fill="#059669" stroke="#047857" stroke-width="1.5"/>
<text x="145" y="293" text-anchor="middle" fill="white" font-weight="bold">🔑 Secret</text>
<text x="145" y="311" text-anchor="middle" fill="#d1fae5" font-size="11">sqs-creds-test001</text>
<text x="145" y="325" text-anchor="middle" fill="#d1fae5" font-size="10">access_key / secret_key</text>
<!-- ConfigMap -->
<rect x="260" y="270" width="180" height="60" rx="7" fill="#d97706" stroke="#b45309" stroke-width="1.5"/>
<text x="350" y="293" text-anchor="middle" fill="white" font-weight="bold">📄 ConfigMap</text>
<text x="350" y="311" text-anchor="middle" fill="#fef3c7" font-size="11">sqs-cfg-test001</text>
<text x="350" y="325" text-anchor="middle" fill="#fef3c7" font-size="10">elasticmq.conf</text>
<!-- PVC -->
<rect x="465" y="270" width="180" height="60" rx="7" fill="#0891b2" stroke="#0e7490" stroke-width="1.5"/>
<text x="555" y="293" text-anchor="middle" fill="white" font-weight="bold">💾 PVC</text>
<text x="555" y="311" text-anchor="middle" fill="#cffafe" font-size="11">sqs-data-test001</text>
<text x="555" y="325" text-anchor="middle" fill="#cffafe" font-size="10">H2 persistence (остаётся при удалении CR)</text>
<!-- === Deployment === -->
<rect x="55" y="365" width="840" height="0" rx="0" fill="none"/>
<!-- Deployment box -->
<rect x="160" y="360" width="380" height="120" rx="9" fill="#f1f5f9" stroke="#475569" stroke-width="2"/>
<text x="350" y="380" text-anchor="middle" fill="#334155" font-weight="bold" font-size="12">🚀 Deployment: sqs-test001</text>
<!-- Container ElasticMQ -->
<rect x="175" y="390" width="160" height="75" rx="6" fill="#e2e8f0" stroke="#64748b" stroke-width="1"/>
<text x="255" y="410" text-anchor="middle" fill="#1e293b" font-weight="bold" font-size="11">ElasticMQ</text>
<text x="255" y="427" text-anchor="middle" fill="#475569" font-size="10">port 9324</text>
<text x="255" y="442" text-anchor="middle" fill="#475569" font-size="10">Scala / Akka HTTP</text>
<text x="255" y="457" text-anchor="middle" fill="#64748b" font-size="10">elasticmq:1.7.1</text>
<!-- Container UI -->
<rect x="355" y="390" width="170" height="75" rx="6" fill="#e2e8f0" stroke="#64748b" stroke-width="1"/>
<text x="440" y="410" text-anchor="middle" fill="#1e293b" font-weight="bold" font-size="11">elasticmq-ui</text>
<text x="440" y="427" text-anchor="middle" fill="#475569" font-size="10">port 3000</text>
<text x="440" y="442" text-anchor="middle" fill="#475569" font-size="10">Next.js</text>
<text x="440" y="457" text-anchor="middle" fill="#64748b" font-size="10">elasticmq-ui:latest</text>
<!-- Arrows ConfigMap/PVC -> Deployment -->
<line x1="350" y1="330" x2="350" y2="360" stroke="#b45309" stroke-width="1.5" stroke-dasharray="4,2" marker-end="url(#arr)"/>
<line x1="555" y1="330" x2="430" y2="360" stroke="#0e7490" stroke-width="1.5" stroke-dasharray="4,2" marker-end="url(#arr)"/>
<text x="470" y="350" fill="#64748b" font-size="10">mount</text>
<!-- === Service === -->
<rect x="600" y="380" width="200" height="65" rx="7" fill="#6366f1" stroke="#4f46e5" stroke-width="1.5"/>
<text x="700" y="403" text-anchor="middle" fill="white" font-weight="bold">🔌 Service ClusterIP</text>
<text x="700" y="421" text-anchor="middle" fill="#e0e7ff" font-size="11">sqs-svc-test001</text>
<text x="700" y="437" text-anchor="middle" fill="#e0e7ff" font-size="11">9324 (SQS) · 3000 (UI)</text>
<!-- Arrow Deployment -> Service -->
<line x1="540" y1="415" x2="600" y2="415" stroke="#666" stroke-width="1.5" marker-end="url(#arr)"/>
<!-- === Ingresses === -->
<!-- ING1 -->
<rect x="55" y="520" width="185" height="65" rx="7" fill="#db2777" stroke="#be185d" stroke-width="1.5"/>
<text x="147" y="543" text-anchor="middle" fill="white" font-weight="bold">🌐 Ingress SQS API</text>
<text x="147" y="560" text-anchor="middle" fill="#fce7f3" font-size="10">sqs-ing-test001</text>
<text x="147" y="575" text-anchor="middle" fill="#fce7f3" font-size="10">/sqs/test001/... → :9324</text>
<!-- ING2 -->
<rect x="260" y="520" width="185" height="65" rx="7" fill="#db2777" stroke="#be185d" stroke-width="1.5"/>
<text x="352" y="543" text-anchor="middle" fill="white" font-weight="bold">🌐 Ingress UI</text>
<text x="352" y="560" text-anchor="middle" fill="#fce7f3" font-size="10">sqs-ing-ui-test001</text>
<text x="352" y="575" text-anchor="middle" fill="#fce7f3" font-size="10">/sqs-ui/test001/ → :3000</text>
<!-- ING3 -->
<rect x="465" y="520" width="185" height="65" rx="7" fill="#db2777" stroke="#be185d" stroke-width="1.5"/>
<text x="557" y="543" text-anchor="middle" fill="white" font-weight="bold">🌐 Ingress Assets</text>
<text x="557" y="560" text-anchor="middle" fill="#fce7f3" font-size="10">sqs-ing-ui-assets-test001</text>
<text x="557" y="575" text-anchor="middle" fill="#fce7f3" font-size="10">/_next/ → :3000</text>
<!-- ING4 -->
<rect x="670" y="520" width="185" height="65" rx="7" fill="#db2777" stroke="#be185d" stroke-width="1.5"/>
<text x="762" y="543" text-anchor="middle" fill="white" font-weight="bold">🌐 Ingress Routes</text>
<text x="762" y="560" text-anchor="middle" fill="#fce7f3" font-size="10">sqs-ing-ui-queues-test001</text>
<text x="762" y="575" text-anchor="middle" fill="#fce7f3" font-size="10">/queues/ → :3000</text>
<!-- Arrows Service -> Ingresses -->
<line x1="700" y1="445" x2="700" y2="490" stroke="#4f46e5" stroke-width="1" stroke-dasharray="4,2"/>
<line x1="700" y1="490" x2="147" y2="490" stroke="#4f46e5" stroke-width="1" stroke-dasharray="4,2"/>
<line x1="147" y1="490" x2="147" y2="520" stroke="#4f46e5" stroke-width="1" marker-end="url(#arr)"/>
<line x1="352" y1="490" x2="352" y2="520" stroke="#4f46e5" stroke-width="1" marker-end="url(#arr)"/>
<line x1="557" y1="490" x2="557" y2="520" stroke="#4f46e5" stroke-width="1" marker-end="url(#arr)"/>
<line x1="700" y1="490" x2="762" y2="490" stroke="#4f46e5" stroke-width="1" stroke-dasharray="4,2"/>
<line x1="762" y1="490" x2="762" y2="520" stroke="#4f46e5" stroke-width="1" marker-end="url(#arr)"/>
<!-- Client -->
<rect x="340" y="630" width="220" height="45" rx="8" fill="#1a1a2e" stroke="#334155" stroke-width="1.5"/>
<text x="450" y="650" text-anchor="middle" fill="white" font-weight="bold">🖥️ Browser / AWS SDK</text>
<text x="450" y="667" text-anchor="middle" fill="#94a3b8" font-size="11">sqs.kube5s.ru (HTTPS)</text>
<!-- Arrow Client -> Ingresses -->
<line x1="380" y1="630" x2="200" y2="588" stroke="#6b7280" stroke-width="1.5" marker-end="url(#arr)"/>
<line x1="450" y1="630" x2="420" y2="588" stroke="#6b7280" stroke-width="1.5" marker-end="url(#arr)"/>
<!-- Arrow marker -->
<defs>
<marker id="arr" markerWidth="8" markerHeight="8" refX="6" refY="3" orient="auto">
<path d="M0,0 L0,6 L8,3 z" fill="#666"/>
</marker>
</defs>
</svg>