How to Monitor Kubernetes Pod Status and Resources on Linux Server

Step-by-step guide to monitor Kubernetes pod status and resource usage. Track pod health, monitor CPU and memory consumption, and ensure reliable containerized applications.

Last updated: 2026-01-11

How to Monitor Kubernetes Pod Status and Resources on Linux Server

Monitor Kubernetes pod status and resources to track pod health, detect failures, and optimize resource allocation. This guide shows you how to monitor pods and set up automated monitoring.

For comprehensive Kubernetes monitoring, see Kubernetes Monitoring. For troubleshooting pod issues, see Docker Container Crash Restart Loop.

Why Monitoring Pod Status Matters

Kubernetes pod monitoring helps identify pod failures, resource exhaustion, and performance issues. Monitoring pod status ensures reliable containerized applications and optimal resource utilization.

Method 1: Check Pod Status with kubectl

List Pod Status

# List all pods
kubectl get pods

# Get pod status details
kubectl get pods -o wide

# Check pod status in namespace
kubectl get pods -n <namespace>

# Get pod details
kubectl describe pod <pod-name>

# Check pod status with custom format
kubectl get pods -o custom-columns=NAME:.metadata.name,STATUS:.status.phase,RESTARTS:.status.containerStatuses[0].restartCount

Monitor Pod Resources

# Get pod resource usage
kubectl top pods

# Get pod resource usage in namespace
kubectl top pods -n <namespace>

# Get node resource usage
kubectl top nodes

# Get detailed resource metrics
kubectl get --raw /apis/metrics.k8s.io/v1beta1/pods

Method 2: Check Pod Restart Status

Monitor Pod Restarts

# List pods with restart count
kubectl get pods -o custom-columns=NAME:.metadata.name,RESTARTS:.status.containerStatuses[0].restartCount,STATUS:.status.phase

# Find pods with high restart count
kubectl get pods --field-selector=status.phase=Running -o json | jq '.items[] | select(.status.containerStatuses[0].restartCount > 3) | .metadata.name'

# Check pod restart history
kubectl get pod <pod-name> -o jsonpath='{.status.containerStatuses[0].restartCount}'

Method 3: Automated Pod Monitoring with Zuzia.app

Set up automated monitoring to track pod status continuously and receive alerts when pods fail or resource usage exceeds thresholds.

Step 1: Add Pod Monitoring Command

  1. Log in to Zuzia.app Dashboard

    • Access your Zuzia.app account
    • Navigate to your server
    • Click "Add Scheduled Task"
  2. Configure Pod Status Check Command

    kubectl get pods --field-selector=status.phase!=Running --no-headers | wc -l
    
    • Set execution frequency (every 2-5 minutes)
    • Configure alerts when pods fail

Step 2: Configure Alert Thresholds

  • Warning: 1 pod not running
  • Critical: > 10% pods not running
  • Emergency: > 50% pods not running

Step 3: Monitor Pod Resources

Add command to monitor pod resource usage:

# Check pod CPU usage
kubectl top pods --no-headers | awk '{if ($2+0 > 80) print $1, $2}'

Best Practices for Pod Monitoring

1. Monitor All Pods Continuously

  • Track pod status for all namespaces
  • Monitor pod restart counts
  • Alert when pods fail
  • Ensure sufficient pod replicas

2. Monitor Pod Resources

  • Track CPU and memory usage per pod
  • Alert when resources exceed thresholds
  • Monitor resource trends over time
  • Optimize resource allocation

3. Set Up Comprehensive Alerts

  • Configure alerts for pod failures
  • Set up alerts for resource exhaustion
  • Monitor pod restart frequency
  • Alert on deployment issues
  • Review pod performance trends weekly
  • Identify pod failure patterns
  • Optimize resource allocation based on trends
  • Correlate pod issues with application changes

Troubleshooting Pod Issues

Step 1: Identify Pod Problems

When pods have issues:

# Check pod status
kubectl get pods

# View pod events
kubectl describe pod <pod-name>

# Check pod logs
kubectl logs <pod-name>

# Check pod resource usage
kubectl top pod <pod-name>

Step 2: Resolve Pod Issues

Based on investigation:

  1. Fix Pod Failures:

    • Restart failed pods
    • Fix application bugs
    • Update pod configuration
  2. Optimize Pod Resources:

    • Adjust resource requests and limits
    • Optimize pod configuration
    • Scale pods if needed

FAQ: Common Questions About Pod Monitoring

How often should I check pod status?

For production Kubernetes clusters, continuous automated monitoring is essential. Zuzia.app can check pod status every few minutes, storing historical data and alerting you when pods fail.

What should I monitor for pods?

Monitor pod status, pod resource usage (CPU and memory), pod restart counts, pod availability, and deployment status. Focus on metrics that impact application availability and performance.

How do I monitor pods across multiple clusters?

Zuzia.app allows you to monitor Kubernetes clusters across multiple environments from one centralized dashboard. Each cluster executes monitoring commands independently, and all results are stored for centralized analysis.

Can pod monitoring impact cluster performance?

Pod monitoring commands have minimal impact on cluster performance when done correctly. Use appropriate monitoring frequency and ensure monitoring doesn't interfere with application workloads.

Note: The content above is part of our brainstorming and planning process. Not all described features are yet available in the current version of Zuzia.

If you'd like to achieve what's described in this article, please contact us – we'd be happy to work on it and tailor the solution to your needs.

In the meantime, we invite you to try out Zuzia's current features – server monitoring, SSL checks, task management, and many more.

We use cookies to ensure the proper functioning of our website.