Show detailed node status and resource utilization
Display detailed node status, resource utilization, and health conditions across your Kubernetes cluster. Use this to identify resource pressure, find unhealthy nodes, and analyze pod distribution for troubleshooting and optimization.
/plugin marketplace add kcns008/cluster-code/plugin install kcns008-cluster-core-plugins-cluster-core@kcns008/cluster-codesonnetI'll provide comprehensive information about cluster node health, resource utilization, and pod distribution.
# Basic node information
kubectl get nodes -o wide
kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.capacity.cpu}{"\t"}{.status.capacity.memory}{"\t"}{.status.capacity.ephemeral-storage}{"\t"}{.status.allocatable.cpu}{"\t"}{.status.allocatable.memory}{"\n"}{end}'
# Node conditions analysis
kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{range .status.conditions[*]}{.type}{"="}{.status}{" - "}{.reason}{": "}{.message}{"\n"}{end}{"\n"}'
# Find unhealthy nodes
kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{range .status.conditions[*]}{.type}{"="}{.status}{"\n"}{end}{"\n"}' | grep -A 5 "False"
{{#if detailed}}
# Resource utilization
kubectl top nodes 2>/dev/null || echo "Metrics server not installed"
# Pod distribution per node
kubectl get pods --all-namespaces -o wide --sort-by=.spec.nodeName
# Taints and tolerations
kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\nTaints: "}{range .spec.taints[*]}{.key}{"="}{.value}{":"}{.effect}{" "}{end}{"\n\n"}{end}'
# Node labels
kubectl get nodes --show-labels
{{#if node}} Analysis for node: {{node}}
# Detailed node description
kubectl describe node {{node}}
# Pods running on this node
kubectl get pods --all-namespaces --field-selector=spec.nodeName={{node}} -o wide
# Resource usage for this node's pods
kubectl top pods --all-namespaces --field-selector=spec.nodeName={{node}} 2>/dev/null || echo "Pod metrics not available"
{{/if}} {{/if}}
# Cluster resource summary
kubectl describe nodes | grep -A 5 "Allocated resources"
# Resource pressure detection
kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{range .status.conditions[*]}{.type}{"="}{.status}{"\n"}{end}{"\n"}' | grep -A 1 "MemoryPressure\|DiskPressure\|PIDPressure"
I'll help identify:
Based on the analysis, I can help you:
kubectl drain <node-name> --ignore-daemonsetskubectl uncordon <node-name>kubectl label nodes <node-name> <key>=<value>kubectl taint nodes <node-name> <key>=<value>:<effect>Would you like me to proceed with the node status analysis?