Created
June 28, 2019 15:19
-
-
Save viniciusjssouza/4e0bc176cde2df8d75a94647fca46d7d to your computer and use it in GitHub Desktop.
access the logs of a running container inside a POD
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
| #/bin/bash | |
| # Access the current logs of the provided POD | |
| # | |
| # Parameter 1: the app name, which should match the deployment name (<app name>-deployment) and the container name. | |
| POD_NAME=$(kubectl get pods -n stock --no-headers -o custom-columns=":metadata.name" | grep -m1 "$1-deployment") | |
| echo "Acessing pod $POD_NAME" | |
| kubectl logs "$POD_NAME" -n stock -c "$1" --follow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment