Before you start running commands in a production cluster, ensure you have the appropriate approvals and that your kubeconfig/context points to the correct cluster.
Step 1 — Verify cluster access and find the namespace
Start by listing namespaces to confirm you can reach the cluster and to identify where the payment components live.- A
paymentnamespace exists — this is our primary target based on the alert (“payment service down”). - Confirming namespace presence is a quick way to assert you have cluster visibility before deeper debugging.
Step 2 — Inspect resources inside the payment namespace
List all high-level resources (pods, services, deployments, replica sets) to get an immediate surface-level view.- Some pods are
Running, but that does not guarantee the application is healthy or accepting traffic. - The
payment-gateway-apideployment shows0replicas — this is notable and could indicate the API has been scaled to zero, failed to create pods, or is stuck on rollout.
Two primary next investigation paths
- Check pod logs, events, and readiness/liveness probe results to surface runtime errors.
- Verify service endpoints and traffic routing, and if needed, test the API from inside the cluster.
Step 3 — List services to confirm how the app is exposed
Get services in thepayment namespace to confirm cluster-internal exposure and ports.
- These are
ClusterIPservices (internal cluster addresses).EXTERNAL-IPis<none>, which is expected for ClusterIP. - To reach these services from outside the cluster, use port-forwarding, an ingress, or a debug pod.
Useful commands and why to run them
Below are the commands you’ll commonly use during the next phase of debugging, with the reason to run each.
Examples (commands shown earlier in context):
How to interpret different outcomes
- Endpoints missing for a service:
- Service cannot route traffic. Investigate pod labels/selectors and deployment scaling. Check if replicas were intentionally scaled to zero or if pods failed to start.
- Pods
Runningbut logs show errors or readiness probe failures:- Fix the application error, adjust configuration, or roll back to a known-good image/configuration. Look at probe definitions in the Deployment manifest and at recent changes in the image or config.
- Service healthy internally but external users experiencing failures:
- Investigate ingress controllers, external load balancers, network policies, and DNS. Ensure the path from the external load balancer to the ClusterIP is healthy.
Quick checklist for narrowing root cause
- Confirm cluster access and correct kube-context.
- Verify the
paymentnamespace and list resources withkubectl get all -n payment. - Check service endpoints (missing endpoints often indicate selector/label mismatches or zero replicas).
- Describe pods for events and readiness/liveness probe failures.
- Stream or inspect logs (including
--previous) for runtime exceptions or stack traces. - Port-forward or run a debug pod to test cluster-internal connectivity and API responses.
- If necessary, check ingress/load balancer and network policies for external reachability issues.