diff --git a/podstatus/app.py b/podstatus/app.py index 2c59a01..25f6a9a 100644 --- a/podstatus/app.py +++ b/podstatus/app.py @@ -119,8 +119,9 @@ def watch_pods(): pod_index = pod.metadata.labels.get( "statefulset.kubernetes.io/pod-name", "unknown" ) + pod_node = pod.spec.node_name if pod.spec.node_name else "unknown" - yield f'data: {{"name": "{pod_name}", "status": "{pod_status}", "index": "{pod_index}"}}\n\n' + yield f'data: {{"name": "{pod_name}", "status": "{pod_status}", "index": "{pod_index}", "node": "{pod_node}"}}\n\n' except Exception as e: logging.error(f"Error watching pods: {e}") diff --git a/podstatus/templates/index.html b/podstatus/templates/index.html index 54a9d1f..856d908 100644 --- a/podstatus/templates/index.html +++ b/podstatus/templates/index.html @@ -24,6 +24,7 @@