KUBERNETES(1) kubernetes KUBERNETES(1) (NAME) kubectl-logs - (SYNOPSIS) kubectl logs [OPTIONS] (DESCRIPTION) . . (OPTIONS) --all-containers=false (). --all-pods=false (). prefix true . -c, --container="" -f, --follow=false (stream) . --ignore-errors=false / (non-fatal) --insecure-skip-tls-verify-backend=false kubelet . . kubelet . --limit-bytes=0 . . --max-log-requests=5 selector . . --pod-running-timeout=20s ( 5s 2m 3h ) --prefix=false ( ) -p, --previous=false true . -l, --selector="" ( ) '=' '==' '!=' 'in' 'notin' ( -l key1=value1,key2=value2,key3 in (value3)). . --since=0s 5s 2m 3h. . since-time since . --since-time="" (RFC3339). . since-time since . --tail=-1 . selector 1- selector 10 . --timestamps=false (timestamps) (OPTIONS INHERITED FROM PARENT COMMANDS) --as="" (impersonate) . (service account) . --as-group=[] . --as-uid="" UID . --as-user-extra=[] . --cache-dir="/home/username/.kube/cache" --certificate-authority="" (certificate authority) --client-certificate="" TLS --client-key="" TLS --cluster="" kubeconfig --context="" kubeconfig --disable-compression=false true --insecure-skip-tls-verify=false true . HTTPS --kubeconfig="" kubeconfig CLI. --kuberc="" kuberc (preferences). export feature gate KUBECTL_KUBERC=false KUBERC=off . --match-server-version=false -n, --namespace="" (namespace) CLI --password="" (basic authentication) API --profile="none" . (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) --profile-output="profile.pprof" --request-timeout="0" . ( 1s 2m 3h). (timeout) . -s, --server="" Kubernetes API --tls-server-name="" . --token="" (Bearer token) API --user="" kubeconfig --username="" API --version=false --version --version=raw --version=vX.Y.Z... --warnings-as-errors=false (EXAMPLES) # (snapshot) nginx kubectl logs nginx # nginx kubectl logs nginx --prefix # nginx kubectl logs nginx --limit-bytes=500 # nginx kubectl logs nginx --pod-running-timeout=20s # nginx kubectl logs nginx --all-containers=true # nginx kubectl logs deployment/nginx --all-pods=true # app=nginx kubectl logs -l app=nginx --all-containers=true # app=nginx kubectl logs -l app=nginx --max-log-requests=10 # ruby web-1 kubectl logs -p -c ruby web-1 # nginx kubectl logs nginx -f --ignore-errors=true # ruby web-1 kubectl logs -f -c ruby web-1 # app=nginx kubectl logs -f -l app=nginx --all-containers=true # nginx kubectl logs --tail=20 nginx # nginx kubectl logs --since=1h nginx # nginx 06:00:00 UTC kubectl logs nginx --since-time=2024-08-30T06:00:00Z --timestamps=true # kubelet kubectl logs --insecure-skip-tls-verify-backend nginx # job hello kubectl logs job/hello # nginx-1 nginx kubectl logs deployment/nginx -c nginx-1 (SEE ALSO) kubectl(1), (HISTORY) Eric Paris (eparis at redhat dot com) kubernetes ! Eric Paris Jan 2015 KUBERNETES(1)