softwarewala.ss: post #512 — TG.ME

kubernetes logs:- 1.kubectl logs <pod-name> - This command retrieves the logs of a specific pod. 2. kubectl logs -f <pod-name> - This command streams the logs of a specific pod in real-time, useful for monitoring logs as they occur. 3. kubectl logs <pod-name> <container-name> - This command retrieves the logs of a specific container running in a pod with multiple containers. 4. kubectl logs -f <pod-name> <container-name> - This command streams the logs of a specific container running in a pod with multiple containers in real-time. 5. kubectl logs --tail=<number-of-lines> <pod-name> - This command retrieves the specified number of lines from the end of the logs of a specific pod. 6. kubectl logs --since=<time> <pod-name> - This command retrieves the logs of a specific pod since a specified time. The time parameter can be specified in the format of 10s for 10 seconds, 1m for 1 minute, 1h for 1 hour, or 1d for 1 day. 7. kubectl logs --timestamps <pod-name> - This command adds timestamps to the logs of a specific pod. 8. kubectl logs --previous <pod-name> - This command retrieves the logs of the previous container instance of a specific pod. This is useful for debugging issues after a pod has been restarted. 9. kubectl logs <pod-name> -c <container-name> - This command retrieves the logs of a specific container in a specific pod. 10. kubectl logs <pod-name> -n <namespace-name> - This command retrieves the logs of a specific pod in a specific namespace. 11. kubectl logs <pod-name> --all-containers - This command retrieves the logs of all containers running in a specific pod.

April 15, 2025 1.3K 6