Last active
July 25, 2022 13:12
-
-
Save rsperl/fb90479874f5fd70edd543650358a313 to your computer and use it in GitHub Desktop.
kubectl commands #k8s #snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Get logs for all pods with a given label | |
| kubectl logs -f -l app=my-app-label | |
| # Get pod labels | |
| kubectl get pods --show-labels | |
| # ^^^ can be messy, so if your app label is the name of the deployment, | |
| # just list the deployments | |
| kubectl get deployments | |
| # and then get logs for that app=deployment | |
| kubectl logs -f -l app=my-deployment | |
| ######## | |
| # see also https://kubernetes.io/docs/reference/kubectl/cheatsheet/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment