Last active
October 17, 2020 06:53
-
-
Save sumanthkumarc/8216c00a9d98834f0eedd833696ea04c to your computer and use it in GitHub Desktop.
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
# Make target | |
port-forward: | |
while true; do \ | |
kubectl port-forward -n my-ns service/mongodb-0 27017:27017 & \ | |
kubectl port-forward -n my-ns service/mongodb-1 27011:27017 & \ | |
kubectl port-forward -n my-ns service/mongodb-2 27012:27017 & \ | |
kubectl port-forward -n my-ns service/mongodb-3 27013:27017 & \ | |
kubectl port-forward -n my-ns service/mongodb-arbiter-0 27014:27017 \ | |
done; | |
# Shell command | |
(trap 'kill 0' INT; kubectl -n my-ns port-forward service/mongodb-0 27017:27017 & kubectl -n my-ns port-forward service/mongodb-1 27011:27017 & kubectl port-forward -n my-ns service/mongodb-2 27012:27017 & kubectl port-forward -n my-ns service/mongodb-3 27013:27017 & kubectl port-forward -n my-ns service/mongodb-arbiter-0 27014:27017) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment