Repository navigation
Expand file tree
/
Copy pathkubernetes.html
More file actions
120 lines (115 loc) · 16.2 KB
/
Copy pathkubernetes.html
File metadata and controls
120 lines (115 loc) · 16.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Recursos Kubernetes — devsu-demo-devops-java</title>
<style>
:root{--bg:#0b1220;--bg2:#111c33;--line:#2b3d63;--txt:#e8eefc;--mut:#9fb0cc;--wl:#34d399;--net:#38bdf8;--route:#a78bfa;--cfg:#fbbf24;--sec:#f472b6;--scl:#2dd4bf}
*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--txt)}
header{background:linear-gradient(135deg,#0b1220,#232a5e 60%,#0c3c4e);padding:32px 20px 24px;text-align:center;border-bottom:1px solid var(--line)}
header h1{margin:0 0 8px;font-size:1.55rem}header p{margin:6px auto;max-width:880px;color:var(--mut);font-size:.9rem}
.badges{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:12px}
.badges span{background:#0f1d3a;border:1px solid var(--line);border-radius:999px;padding:5px 13px;font-size:.75rem;color:#dbe7ff}
.badges code{color:#7dd3fc}
main{max-width:1120px;margin:0 auto;padding:20px 14px 46px}
.panel{background:var(--bg2);border:1px solid var(--line);border-radius:16px;padding:16px;margin-bottom:18px}
.panel h2{margin:0 0 4px;font-size:1.05rem}.sub{margin:0 0 12px;color:var(--mut);font-size:.83rem}
.legend{display:flex;flex-wrap:wrap;gap:8px;font-size:.78rem}
.chip{display:inline-flex;align-items:center;gap:7px;background:#0f1d3a;border:1px solid var(--line);border-radius:999px;padding:5px 11px}
.sw{width:13px;height:13px;border-radius:4px;display:inline-block}
.ns{background:#0d1730;border:1px dashed var(--route);border-radius:14px;padding:14px;margin-top:6px}
.ns h3{margin:0 0 2px;font-size:.95rem}.ns .scope{color:var(--mut);font-size:.78rem;margin:0 0 10px}
.diagram-scroll{overflow:auto;border-radius:12px;border:1px solid var(--line);background:#0a1122}
.diagram-scroll svg{display:block;min-width:780px;width:100%;height:auto}
.zoom{display:flex;gap:6px}.zoom button{background:#0f1d3a;color:#dbe7ff;border:1px solid var(--line);border-radius:8px;padding:3px 10px;cursor:pointer;font-size:.8rem}
.bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:10px}
.card{background:#16233f;border:1px solid var(--line);border-left:6px solid;border-radius:12px;padding:12px;font-size:.8rem}
.card h4{margin:0 0 4px;font-size:.86rem;display:flex;align-items:center;gap:8px}
.card code{font-size:.7rem;background:#0a1122;border:1px solid var(--line);color:#cde6ff;border-radius:6px;padding:1px 6px;display:inline-block;margin:2px 3px 2px 0}
.card ul{margin:6px 0 0;padding-left:16px;color:#c9d6f2}.card li{margin:2px 0}
.card.cond{border-style:dashed;border-color:var(--sec)}
.c-wl{border-left-color:var(--wl)}.c-net{border-left-color:var(--net)}.c-route{border-left-color:var(--route)}.c-cfg{border-left-color:var(--cfg)}.c-sec{border-left-color:var(--sec)}.c-scl{border-left-color:var(--scl)}
.tag{font-size:.64rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em;border-radius:999px;padding:2px 9px}
.tag.t{background:#06334d;color:#67e8f9}.tag.c{background:#4a2305;color:#fdba74}.tag.nc{background:#3a3a3a;color:#d4d4d4}
table{width:100%;border-collapse:collapse;font-size:.78rem}th,td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--line);vertical-align:top}th{background:#0f1d3a}td{color:#d5e1f7}td code{color:#7dd3fc;font-size:.72rem}
.note{color:var(--mut);font-size:.78rem}
footer{text-align:center;color:var(--mut);font-size:.74rem;padding:16px}
@media(max-width:640px){header h1{font-size:1.15rem}table{font-size:.7rem}}
</style>
</head>
<body>
<header>
<h1>Recursos Kubernetes (Helm)</h1>
<p>Chart <code>ms-template 1.0.0</code> · 5 plantillas en <code>kubernetes/templates/</code> renderizadas con <code>values.template → values.yaml</code> vía <code>envsubst</code> + <code>helm upgrade --install</code>. Agrupado por namespace <code>sis-<rama>-ms</code> y aplicación <code><repo></code>. Sin valores sensibles en el repo.</p>
<div class="badges"><span>templates: <code>deployment · svc · ingress · configmap · autoscaling</code></span><span>tráfico: <code>:80 → targetPort 8000</code></span><span>réplicas <code>2</code> · HPA <code>2–4 · cpu 60%</code></span><span>namespace por valor, no manifiesto</span></div>
</header>
<main>
<div class="panel">
<h2>Leyenda</h2>
<p class="sub">Color por tipo · tarjeta continua = render siempre · discontinua = condicional / sin consumidor confirmado</p>
<div class="legend">
<span class="chip"><i class="sw" style="background:#34d399"></i>Workload (Deployment/Pod)</span>
<span class="chip"><i class="sw" style="background:#38bdf8"></i>Red (Service)</span>
<span class="chip"><i class="sw" style="background:#a78bfa"></i>IngressRoute Traefik</span>
<span class="chip"><i class="sw" style="background:#fbbf24"></i>ConfigMap</span>
<span class="chip"><i class="sw" style="background:#f472b6"></i>Secret (condicional)</span>
<span class="chip"><i class="sw" style="background:#2dd4bf"></i>HPA</span>
<span class="chip">→ tráfico / dependencia</span>
</div>
</div>
<div class="panel">
<div class="bar"><div><h2 style="margin:0">Diagrama de tráfico y dependencias (SVG)</h2><p class="sub" style="margin:4px 0 0">Internet → IngressRoute (<code>Host + PathPrefix</code>) → Service <code>:80</code> → Pods <code>:8000</code> · HPA escala el Deployment</p></div><div class="zoom"><button onclick="zoom('d',1)">+</button><button onclick="zoom('d',-1)">−</button></div></div>
<div class="diagram-scroll" id="d"><svg viewBox="0 0 940 560" role="img" aria-label="Diagrama Kubernetes" font-family="system-ui,sans-serif">
<defs><marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M0,0L10,5L0,10z" fill="#7dd3fc"/></marker><marker id="ad" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M0,0L10,5L0,10z" fill="#f472b6"/></marker></defs>
<rect x="12" y="12" width="916" height="536" rx="18" fill="none" stroke="#a78bfa" stroke-width="2" stroke-dasharray="10 6"/>
<text x="30" y="40" fill="#c4b5fd" font-size="14" font-weight="700">namespace: sis-<rama>-ms (valor templado, no manifiesto) · app: <repo></text>
<rect x="30" y="70" width="160" height="64" rx="12" fill="#0f1d3a" stroke="#7dd3fc" stroke-width="2"/><text x="110" y="96" text-anchor="middle" fill="#e8eefc" font-size="13" font-weight="700">🌐 Internet</text><text x="110" y="115" text-anchor="middle" fill="#9fb0cc" font-size="11">Host + PathPrefix</text>
<rect x="230" y="60" width="220" height="84" rx="12" fill="#16233f" stroke="#a78bfa" stroke-width="2.5"/><text x="340" y="86" text-anchor="middle" fill="#e8eefc" font-size="13" font-weight="700">IngressRoute traefik</text><text x="340" y="105" text-anchor="middle" fill="#9fb0cc" font-size="11"><repo>-ingress · entry web</text><text x="340" y="122" text-anchor="middle" fill="#9fb0cc" font-size="11">→ svc puerto 80 (fijo)</text>
<rect x="490" y="60" width="200" height="84" rx="12" fill="#16233f" stroke="#38bdf8" stroke-width="2.5"/><text x="590" y="86" text-anchor="middle" fill="#e8eefc" font-size="13" font-weight="700">Service ClusterIP</text><text x="590" y="105" text-anchor="middle" fill="#9fb0cc" font-size="11"><repo>-svc :80</text><text x="590" y="122" text-anchor="middle" fill="#9fb0cc" font-size="11">targetPort 8000</text>
<rect x="200" y="200" width="480" height="120" rx="12" fill="#16233f" stroke="#34d399" stroke-width="2.5"/><text x="440" y="226" text-anchor="middle" fill="#e8eefc" font-size="13" font-weight="700">Deployment <repo>-deployment · réplicas 2</text><text x="440" y="245" text-anchor="middle" fill="#9fb0cc" font-size="11">selector app=<repo> · imagen <org>/<repo>:<tag> · Always</text><text x="440" y="262" text-anchor="middle" fill="#9fb0cc" font-size="11">containerPort 8000 · 0.5–1 cpu · 250–500Mi</text><text x="440" y="279" text-anchor="middle" fill="#9fb0cc" font-size="11">probes httpGet <path>:8000 (15s/5s/2s/3)</text>
<rect x="230" y="350" width="200" height="70" rx="12" fill="#0f1d3a" stroke="#34d399" stroke-width="2"/><text x="330" y="376" text-anchor="middle" fill="#e8eefc" font-size="12" font-weight="700">Pod réplica 1</text><text x="330" y="395" text-anchor="middle" fill="#9fb0cc" font-size="11">:8000 · /api/users*</text>
<rect x="450" y="350" width="200" height="70" rx="12" fill="#0f1d3a" stroke="#34d399" stroke-width="2"/><text x="550" y="376" text-anchor="middle" fill="#e8eefc" font-size="12" font-weight="700">Pod réplica 2…HPA 4</text><text x="550" y="395" text-anchor="middle" fill="#9fb0cc" font-size="11">:8000 · /api/users*</text>
<rect x="710" y="200" width="200" height="120" rx="12" fill="#16233f" stroke="#2dd4bf" stroke-width="2.5"/><text x="810" y="226" text-anchor="middle" fill="#e8eefc" font-size="13" font-weight="700">HPA <repo>-hpa</text><text x="810" y="245" text-anchor="middle" fill="#9fb0cc" font-size="11">min 2 · max 4</text><text x="810" y="262" text-anchor="middle" fill="#9fb0cc" font-size="11">cpu 60% · stab 10s</text>
<rect x="30" y="440" width="280" height="88" rx="12" fill="#16233f" stroke="#fbbf24" stroke-width="2"/><text x="170" y="464" text-anchor="middle" fill="#e8eefc" font-size="12" font-weight="700">ConfigMap <repo>-env-file</text><text x="170" y="482" text-anchor="middle" fill="#9fb0cc" font-size="11">data: fichero .env (ausente)</text><text x="170" y="499" text-anchor="middle" fill="#fcd34d" font-size="11">sin consumidor confirmado</text>
<rect x="620" y="440" width="290" height="88" rx="12" fill="#16233f" stroke="#f472b6" stroke-width="2" stroke-dasharray="8 5"/><text x="765" y="464" text-anchor="middle" fill="#e8eefc" font-size="12" font-weight="700">Secret <repo> (condicional)</text><text x="765" y="482" text-anchor="middle" fill="#9fb0cc" font-size="11">solo si secret.enabled=true</text><text x="765" y="499" text-anchor="middle" fill="#9fb0cc" font-size="11">default false · sin manifiesto</text>
<line x1="190" y1="102" x2="230" y2="102" stroke="#7dd3fc" stroke-width="2" marker-end="url(#a)"/>
<line x1="450" y1="102" x2="490" y2="102" stroke="#7dd3fc" stroke-width="2" marker-end="url(#a)"/><text x="452" y="94" fill="#7dd3fc" font-size="11">:80</text>
<line x1="590" y1="144" x2="590" y2="198" stroke="#7dd3fc" stroke-width="2" marker-end="url(#a)"/><text x="596" y="175" fill="#7dd3fc" font-size="11">selector</text>
<line x1="440" y1="320" x2="330" y2="348" stroke="#7dd3fc" stroke-width="2" marker-end="url(#a)"/>
<line x1="440" y1="320" x2="550" y2="348" stroke="#7dd3fc" stroke-width="2" marker-end="url(#a)"/><text x="446" y="340" fill="#7dd3fc" font-size="11">crea/administra</text>
<line x1="710" y1="260" x2="682" y2="260" stroke="#7dd3fc" stroke-width="2" marker-end="url(#a)"/><text x="700" y="250" fill="#7dd3fc" font-size="11">escala</text>
<line x1="620" y1="484" x2="560" y2="350" stroke="#f472b6" stroke-width="1.6" stroke-dasharray="6 4" marker-end="url(#ad)"/><text x="566" y="430" fill="#f472b6" font-size="11">envFrom (si enabled)</text>
</svg></div>
</div>
<div class="panel">
<h2>Recursos por namespace y aplicación</h2>
<p class="sub">Todos generados por plantillas Helm (ningún manifiesto directo). Nombres efectivos: <code><repo>-deployment / -svc / -ingress / -env-file / -hpa</code> en <code>sis-<rama>-ms</code>.</p>
<div class="ns"><h3>📦 sis-<rama>-ms · app <repo></h3><p class="scope">Chart ms-template · valores vía envsubst (GITHUB_*, ORG, IMAGE_TAG, MS_PATH) · ejemplo: repo <code>devsu-demo-devops-java</code>, rama <code>test</code>, path <code>/api/users</code></p>
<div class="grid">
<div class="card c-route"><h4><svg width="18" height="18" viewBox="0 0 24 24" fill="none"><path d="M4 5h16v10H4z" stroke="#a78bfa" stroke-width="2"/><path d="M4 19h16" stroke="#a78bfa" stroke-width="2"/></svg>IngressRoute <span class="tag t">plantilla</span></h4><code>ingress.yaml · traefik.io/v1alpha1</code><ul><li>entryPoint <code>web</code>, match <code>Host(host) && PathPrefix(path)</code></li><li>destino <code><repo>-svc:80</code> (puerto 80 literal en la plantilla)</li></ul></div>
<div class="card c-net"><h4><svg width="18" height="18" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="8" stroke="#38bdf8" stroke-width="2"/><circle cx="12" cy="12" r="2.5" fill="#38bdf8"/></svg>Service ClusterIP <span class="tag t">plantilla</span></h4><code>svc.yaml</code><ul><li>selector <code>app=<repo></code>, <code>port 80 → targetPort 8000</code> (valores templados)</li></ul></div>
<div class="card c-wl"><h4><svg width="18" height="18" viewBox="0 0 24 24" fill="none"><rect x="4" y="7" width="16" height="12" rx="2" stroke="#34d399" stroke-width="2"/><path d="M9 7V5a2 2 0 012-2h2a2 2 0 012 2v2" stroke="#34d399" stroke-width="2"/></svg>Deployment + Pods <span class="tag t">plantilla</span></h4><code>deployment.yaml · if enabled (true)</code><ul><li><code>replicas 2</code>, imagen <code>${ORG}/${REPO}:${TAG}</code> Always, puerto <code>8000</code></li><li>resources <code>0.5/250Mi → 1/500Mi</code>; liveness+readiness <code>httpGet <path>:8000</code></li></ul></div>
<div class="card c-scl"><h4><svg width="18" height="18" viewBox="0 0 24 24" fill="none"><path d="M4 20V10M10 20V4M16 20v-8M22 20H2" stroke="#2dd4bf" stroke-width="2"/></svg>HPA <span class="tag t">plantilla</span></h4><code>autoscaling.yaml · autoscaling/v2 · kind: HorizontalPodAutoscaler</code><ul><li>objetivo <code>Deployment <repo>-deployment</code>, <code>min 2 / max 4</code>, CPU 60%, estabilización 10s</li></ul></div>
<div class="card c-cfg"><h4><svg width="18" height="18" viewBox="0 0 24 24" fill="none"><path d="M4 6h16v12H4z" stroke="#fbbf24" stroke-width="2"/><path d="M8 10h8M8 14h5" stroke="#fbbf24" stroke-width="2"/></svg>ConfigMap <span class="tag c">sin consumidor confirmado</span></h4><code>configmap.yaml · <repo>-env-file</code><ul><li>data generada de fichero <code>.env</code> (no existe en el repo → contenido no confirmable)</li><li>El Deployment no lo monta ni lo referencia: relación omitida</li></ul></div>
<div class="card c-sec cond"><h4><svg width="18" height="18" viewBox="0 0 24 24" fill="none"><rect x="5" y="10" width="14" height="10" rx="2" stroke="#f472b6" stroke-width="2"/><path d="M8 10V7a4 4 0 018 0v3" stroke="#f472b6" stroke-width="2"/></svg>Secret (referencia) <span class="tag c">condicional · inactivo por defecto</span></h4><code>secret.enabled=false</code><ul><li>Solo <code>envFrom.secretRef:<repo></code> si se activa; no hay manifiesto Secret ni valores</li></ul></div>
</div></div>
</div>
<div class="panel">
<h2>Plantillas ↔ valores</h2>
<table>
<tr><th>Plantilla</th><th>Valores que la determinan</th><th>Efecto</th></tr>
<tr><td><code>deployment.yaml</code></td><td><code>deployment.enabled · name · namespace · container.image/port/path · secret.* · metadata.*</code></td><td>Crea los Pods; secret solo si <code>enabled=true</code></td></tr>
<tr><td><code>svc.yaml</code></td><td><code>name · namespace · service.port (80) · container.port (8000)</code></td><td>ClusterIP <code>:80 → 8000</code> con selector <code>app</code></td></tr>
<tr><td><code>ingress.yaml</code></td><td><code>ingress.entry/host/path · name</code></td><td>Ruta Traefik hacia <code>-svc:80</code></td></tr>
<tr><td><code>configmap.yaml</code></td><td>fichero <code>.env</code> (ausente) · <code>name</code></td><td>Contenido no determinable desde el repo</td></tr>
<tr><td><code>autoscaling.yaml</code></td><td><code>name</code> (límites fijos en plantilla)</td><td>Escala el Deployment 2–4 por CPU</td></tr>
</table>
<p class="note">No definidos en el repo y por tanto no representados: recurso Namespace, ServiceAccount/RBAC, Secret, PV/PVC, StatefulSet/DaemonSet, Ingress nginx estándar (se usa CRD Traefik). Namespace solo como ámbito de agrupación. Puertos/réplicas/selectores mostrados únicamente donde la plantilla los fija.</p>
</div>
</main>
<footer>Fuente: kubernetes/Chart.yaml, values.template, templates/*.yaml · Solo recursos y relaciones confirmadas · Sin modificar el clúster</footer>
<script>var z=1;function zoom(id,d){var el=document.getElementById(id);if(!el)return;var svg=el.querySelector('svg');z+=d>0?0.15:-0.15;if(z<1)z=1;if(z>2)z=2;svg.style.minWidth=Math.round(780*z)+'px';}</script>
</body>
</html>