Skip to main content
In this step-by-step guide, you’ll learn how to diagnose and resolve internal networking issues in Kubernetes using Cilium CNI, NetworkPolicies, and core troubleshooting techniques for Pods and Services. These best practices help ensure cluster connectivity and reliable application delivery.

Table of Contents

  1. Verify CNI Pod Health
    1.1 Using the Cilium CLI
    1.2 Running cilium-debug
    1.3 Checking Node Connectivity
  2. Inspect Network Policies
    2.1 Testing Egress Connectivity
  3. Troubleshoot Pods and Services
    3.1 Checking Pod Status and Logs
    3.2 Port-Forwarding to the Pod
    3.3 Verifying Service Endpoints
  4. Summary
  5. References

1. Verify CNI Pod Health

Start by confirming that all Cilium components are running in the kube-system namespace:
Sample output:
Cilium consists of:
  • A DaemonSet (cilium-<pod>) on each node
  • A single operator pod managing cluster-wide CRDs
Inspect operator logs to catch any errors or warnings:
The image shows a log output from a Kubernetes system, detailing operations related to Cilium, including node taints, pod scheduling, and garbage collection processes.
For agent diagnostics, view a Cilium DaemonSet pod log:

1.1 Using the Cilium CLI

If you have the Cilium CLI installed, quickly check cluster health:
Example:

1.2 Running cilium-debug

Run the built-in debug tool to gather component status:
Key checks include KVStore, API server connectivity, IPAM, and overall cluster health:

1.3 Checking Node Connectivity

Validate inter-node connectivity with cilium-health:

2. Inspect Network Policies

NetworkPolicies can block unintended traffic flows. List all policies across namespaces:
Describe a restrictive policy:
Deleting or modifying NetworkPolicies in production can expose workloads. Always validate in a non-production namespace first.

2.1 Testing Egress Connectivity

Launch a temporary pod to test outbound access:
  • If the request hangs, the policy is blocking egress.
  • To restore connectivity, delete the policy:
Re-run the curl test to confirm successful egress.

3. Troubleshoot Pods and Services

3.1 Checking Pod Status and Logs

List application pods:
If a pod is running but not behaving, inspect its details and events:
The image shows a terminal output displaying Kubernetes pod details, including conditions, volumes, and events related to the deployment and startup of an Nginx container.
Follow up by streaming the logs:

3.2 Port-Forwarding to the Pod

Test direct connectivity by forwarding local port 8080 to the pod’s port 80:
Open your browser or use curl http://localhost:8080 to verify the service response.

3.3 Verifying Service Endpoints

Services provide stable access to Pods. If port-forward works on the pod but fails on the Service:
  1. Describe the Service:
  2. If you see Endpoints: \<none>, the selector may not match any Pods.
  3. Check the Pod labels:
  4. Edit the Service selector to match the Pod labels:
  5. Confirm the endpoint appears:
  6. Forward traffic via the Service:

4. Summary

In this tutorial, you learned how to:
  • Validate Cilium CNI health with pod status, logs, and CLI tools (cilium status, cilium-debug, cilium-health).
  • Inspect and test the impact of NetworkPolicies on egress traffic.
  • Diagnose Pod and Service connectivity with kubectl describe, logs, port-forwarding, and selector verification.
Following these steps will help you quickly identify and resolve internal networking issues in your Kubernetes cluster.

5. References

Watch Video

Practice Lab