Editing Kubectl logs

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#logs
 
* <code>[[kubectl logs --help]]</code>
 
* <code>[[kubectl]] logs [[my-pod]]</code>
 
* <code>[[kubectl logs my-pod -c my-container]]</code>
 
* <code>[[kubectl logs -n my-namespace my-pod]]</code>
 
* <code>[[kubectl logs --previous]] [[my-pod]]</code>
 
  
* <code>[[kubectl]] logs [[my-pod]] -f</code> or <code>[[kubectl]] logs [[my-pod]] --follow</code>
+
[[kubectl logs --help]]
* <code>[[kubectl]] logs my-pod [[--tail]]=25</code>
 
  
* <code>kubectl logs my-pod -p</code> or <code>[[kubectl logs --previous]]</code>
+
kubectl logs
 +
error: expected 'logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]'.
 +
POD or TYPE/NAME is a required argument for the logs command
 +
See 'kubectl logs -h' for help and examples
  
kubectl logs ${POD_NAME} ${CONTAINER_NAME}
+
* <code>[[kubectl]] logs my-pod</code>
 +
* <code>[[kubectl]] logs my-pod [[--tail]]=25</code>
 +
* <code>kubectl logs my-pod -p</code>
  
  [[kubectl]] logs [[job/]][[your-cron-job-name]]
+
  [[kubectl logs --previous]]
  
[[kubectl logs -f]] -n [[karpenter]] $(kubectl get pods -n karpenter -l karpenter=controller -o name)
+
[[Labels]]:
[[kubectl logs -f -n karpenter -l app.kubernetes.io/name=karpenter -c controller]]
 
  
 +
<code>kubectl logs -l app=elasticsearch</code>
  
[[Labels]]:
+
[[kubectl]] logs your_container -c count
* <code>[[kubectl logs -l]] app=elasticsearch</code>
 
* <code>[[kubectl]] logs your_container -c count</code>
 
  
kubectl logs
 
error: expected 'logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]'.
 
POD or TYPE/NAME is a required argument for the logs command
 
See 'kubectl logs -h' for help and examples
 
  
== Related ==
+
== Related terms ==
 
* <code>[[kubectl exec]]</code>
 
* <code>[[kubectl exec]]</code>
 
* [[CKA v1.23]]: [[Evaluate cluster and node logging]]
 
* [[CKA v1.23]]: [[Evaluate cluster and node logging]]
* [[CKA v1.18]]: Display [[Kubernetes scheduler|scheduler]] events
+
* [[CKA v1.18]]: Display [[scheduler]] events
 
* [[CKA v1.18]]: [[Manage cluster component logs]]
 
* [[CKA v1.18]]: [[Manage cluster component logs]]
 
* [[CKA v1.18]]: [[Manage application logs]]
 
* [[CKA v1.18]]: [[Manage application logs]]
 
* [[CKA v1.15]], [[CKA v1.21]]: [[Understand container logging]]
 
* [[CKA v1.15]], [[CKA v1.21]]: [[Understand container logging]]
* <code>[[stern]] (unmaintained)</code>
+
* <code>[[stern -A .]]</code>
 
* <code>[[ktail]]</code>
 
* <code>[[ktail]]</code>
* <code>[[kubectl top]]</code>
+
* [[Sidecar]] container
* <code>[[kubectl get events]]</code>
 
* [[Sidecar container]]
 
 
* [[Kubernetes logging]]
 
* [[Kubernetes logging]]
* [[Fluent Bit]]
 
* [[Pixie]]
 
* [[k logs -n grafana grafana]]
 
  
 
== See also ==
 
== See also ==
 
* {{kubectl logs}}
 
* {{kubectl logs}}
* {{kubectl get}}
+
* {{kubectl}}
* {{K8s troubleshooting}}
+
* {{K8s}}
* {{Kubernetes info}}
 
  
 
[[Category:Kubernetes]]
 
[[Category:Kubernetes]]

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: