Interview Prep/Kubernetes/Cluster operations: certs, drains, rollouts and quotas

`kubectl logs` shows nothing, but the app is clearly running and handling traffic.

BeginnerTroubleshootingCluster operations: certs, drains, rollouts and quotas
Answer

Likely causes → The app writes logs to a file inside the container instead of stdout/stderr, so the container runtime never sees them.

Diagnose →

kubectl exec web-x -- ls -l /var/log/app/ /app/logs 2>/dev/null
kubectl exec web-x -- ls -l /proc/1/fd/1

Fix → Configure the app to log to stdout (or symlink the log file to /dev/stdout, as the official nginx image does). If it truly cannot, add a sidecar that tails the file to its own stdout.

Prevent → Twelve-factor logging in all services, structured JSON to stdout.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Cluster operations: certs, drains, rollouts and quotas