/* * SysDeck - Service Mesh Panel * Author: Jeremy Anderson (https://dcos.net) * * Queries Kubernetes services via `kubectl get svc -A -o json`. Renders * the service list with namespaces. Falls back to a hint card when * kubectl is absent or the cluster is unreachable. */ export async function mount(panel, { bridge, EventBus }) { panel.innerHTML = renderSkeleton(); const data = await bridge.mesh.services(); const items = data?.items ?? []; panel.innerHTML = `

Service Mesh

${items.length} Kubernetes services

${items.map((svc) => ` `).join('') || ''}
NamespaceServiceTypeCluster IPPorts
${svc.metadata.namespace} ${svc.metadata.name} ${svc.spec.type ?? '—'} ${svc.spec.clusterIP ?? '—'} ${(svc.spec.ports ?? []).map((p) => `${p.port}/${p.protocol}`).join(', ') || '—'}
No services. Confirm kubectl is installed and kubeconfig is reachable.
`; EventBus.emit('mesh.loaded', { serviceCount: items.length }); } function renderSkeleton() { return `
`; }