How do I debug a pod?
A. With entering the pod
Use this command to access the pod shell:
kubectl exec -it <pod-name> -n opsramp-agent -- shExample:kubectl exec -it opsramp-master-67ff695467-xr5bg -n opsramp-agent -- shYou can use the same command for worker pods by replacing the pod name.
B. Without entering the pod
Use this command to view logs:
kubectl logs <pod-name> -n opsramp-agentTo view live logs:kubectl logs <pod-name> -n opsramp-agent -fC. Check logs from inside the pod
- Enter the pod using.
kubectl exec -it <pod-name> -n opsramp-agent -- sh - Go to the logs directory.
/var/log/opsramp/ - List the log files:
ls
Log file meanings:
agent.log: Logs from the K8s-2.0 agent.infra-kube-otel-collector.log: Metrics from Kubernetes cluster components.workload-kube-otel-collector.log: Metrics from workloads.