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 4: | Line 4: | ||
* <code>[[kubectl]] logs [[my-pod]]</code> | * <code>[[kubectl]] logs [[my-pod]]</code> | ||
* <code>[[kubectl logs my-pod -c my-container]]</code> | * <code>[[kubectl logs my-pod -c my-container]]</code> | ||
− | |||
* <code>[[kubectl logs --previous]] [[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> | * <code>[[kubectl]] logs [[my-pod]] -f</code> or <code>[[kubectl]] logs [[my-pod]] --follow</code> | ||
* <code>[[kubectl]] logs my-pod [[--tail]]=25</code> | * <code>[[kubectl]] logs my-pod [[--tail]]=25</code> | ||
− | |||
* <code>kubectl logs my-pod -p</code> or <code>[[kubectl logs --previous]]</code> | * <code>kubectl logs my-pod -p</code> or <code>[[kubectl logs --previous]]</code> | ||
Line 16: | Line 13: | ||
[[kubectl]] logs [[job/]][[your-cron-job-name]] | [[kubectl]] logs [[job/]][[your-cron-job-name]] | ||
− | [[kubectl logs -f]] -n | + | [[kubectl logs -f]] -n karpenter $(kubectl get pods -n karpenter -l karpenter=controller -o name) |
− | |||
[[Labels]]: | [[Labels]]: | ||
− | * <code> | + | * <code>kubectl logs -l app=elasticsearch</code> |
* <code>[[kubectl]] logs your_container -c count</code> | * <code>[[kubectl]] logs your_container -c count</code> | ||
Line 36: | Line 32: | ||
* [[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]] | + | * <code>[[stern -A .]]</code> |
* <code>[[ktail]]</code> | * <code>[[ktail]]</code> | ||
* <code>[[kubectl top]]</code> | * <code>[[kubectl top]]</code> | ||
Line 44: | Line 40: | ||
* [[Fluent Bit]] | * [[Fluent Bit]] | ||
* [[Pixie]] | * [[Pixie]] | ||
− | |||
== See also == | == See also == |
Advertising: