Created
June 13, 2018 07:22
-
-
Save luhonghai/38e00c29f5c4e7c2862eb0b296a8206d to your computer and use it in GitHub Desktop.
Kubectl exec pod by label
This file contains 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
kubectl exec --namespace=manadr-dev -it $(kubectl get pod -l "service=mysql" --namespace=manadr-dev -o jsonpath='{.items[0].metadata.name}') -- bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you it works perfectly!