{% extends "base.html" %} {% import "macros/ui.html" as m %} {% block title %}{{ ws_name }} · Clusters{% endblock %} {% block nav_workspaces %}btn-active{% endblock %} {% block content %} {{ m::ws_tabs(ws_name=ws_name, active=ws_active_tab, ws_envs=ws_envs, ws_has_clusters=ws_has_clusters, ws_has_workflows=ws_has_workflows, current_env=current_env) }} {# ── Controls bar ──────────────────────────────────────────────────────────── #}
services
{# ── Live node metrics (cluster top) ──────────────────────────────────────── #} {% if top %} {% if top.nodes %}
Node Metrics
{% for n in top.nodes %} {% endfor %}
Node CPU CPU% Mem Mem%
{{ n.node }} {{ n.cpu }} {% set pct = n.cpu_pct | replace(from="%", to="") | int(default=0) %} {{ n.cpu_pct }} {{ n.mem }} {% set mpct = n.mem_pct | replace(from="%", to="") | int(default=0) %} {{ n.mem_pct }}

{{ top.nodes | length }} node(s) — kubectl top (live)  · 

{% endif %} {% else %}
Node metrics unavailable — metrics-server may not be reachable or no control-plane resolved.
{% endif %} {# ── Pod top panel (loaded on demand) ─────────────────────────────────────── #} {# ── Cluster summary badge (from .cluster-state.json cache) ──────────────── #} {% if cluster_summary %}
{% if cluster_summary.cp_ip %}CP: {{ cluster_summary.cp_ip }}{% endif %} {% if cluster_summary.nodes_total and cluster_summary.nodes_total > 0 %} {{ cluster_summary.nodes_ready }}/{{ cluster_summary.nodes_total }} nodes {% endif %} {% if cluster_summary.pods_total and cluster_summary.pods_total > 0 %} {{ cluster_summary.pods_running }}/{{ cluster_summary.pods_total }} pods {% endif %} {% if cluster_summary.namespaces and cluster_summary.namespaces > 0 %} {{ cluster_summary.namespaces }} ns {% endif %} {% if cluster_summary.deployments and cluster_summary.deployments > 0 %} {{ cluster_summary.deployments }} dply {% endif %} {% if cluster_summary.pvcs_bound and cluster_summary.pvcs_bound > 0 %} {{ cluster_summary.pvcs_bound }} pvcs {% endif %} {% if cluster_summary.version %}{{ cluster_summary.version }}{% endif %} {% if cluster_summary.last_sync %}cache {{ cluster_summary.last_sync | truncate(length=16, end="") }}{% endif %}
{% endif %} {# ── Cluster-mode components — matches `prvng cl l` ───────────────────────── #} {% if cluster_components %}
Cluster Components
{% for comp in cluster_components %} {% endfor %}
# Name Namespace Version Class Resources Placement Deploy Live
{{ loop.index0 }} {{ comp.name }} {% if comp.namespace %}{{ comp.namespace }}{% else %}{% endif %} {% if comp.version %}{{ comp.version }}{% else %}{% endif %} {% if comp.class %} {{ comp.class }} {% else %}{% endif %} {% if comp.resources and comp.resources != "—" %}{{ comp.resources }}{% else %}{% endif %} {% if comp.placement and comp.placement != "—" %}{{ comp.placement }}{% else %}{% endif %} {% if comp.deploy == "completed" %} completed {% elif comp.deploy == "pending" %} pending {% elif comp.deploy == "failed" %} failed {% elif comp.deploy %} {{ comp.deploy }} {% else %} {% endif %} {% if comp.live and comp.live != "" %} {{ comp.live }} {% elif comp.ncl_state and comp.ncl_state != "" %} {% if comp.ncl_state == "completed" %} {{ comp.ncl_state }} {% elif comp.ncl_state == "running" %} {{ comp.ncl_state }} {% elif comp.ncl_state == "failed" %} {{ comp.ncl_state }} {% else %} {{ comp.ncl_state }} {% endif %} {% else %} {% endif %}

{{ cluster_components | length }} component(s)

{% endif %} {# ── Cluster definitions (clusters/*.ncl) ─────────────────────────────────── #} {% if clusters %} {% if clusters.items %}
Cluster Definitions
{% for cl in clusters.items %} {% endfor %}
Name Workspace Env Labels
{{ cl.name }} {{ cl.workspace | default(value="—") }} {{ cl.env | default(value="—") }} {% if cl.config.labels %} {% for k, v in cl.config.labels %} {{ k }}={{ v }} {% endfor %} {% endif %}

{{ clusters.total | default(value=clusters.items | length) }} cluster definition(s)

{% endif %} {% endif %} {% if not cluster_components and not clusters %}
Cluster data unavailable — no cluster provider configured.
{% endif %} {% endblock %} {% block scripts %} {% endblock %}