Created
May 7, 2019 09:57
-
-
Save ws2356/b0003a9a84b8a2e7aa4481772011c3bd to your computer and use it in GitHub Desktop.
拷贝文件到多个匹配的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
#!/usr/bin/env bash | |
set -e | |
ff=$1 | |
pat=${2:-apollon-backend} | |
di=$(dirname $ff) | |
function kube { | |
kubectl --kubeconfig=$HOME/Downloads/wansong.kubeconfig -n c-dev "$@" | |
} | |
pods=$(kube get po | grep -E $pat | awk '{ print $1 }') | |
for po in $pods ; do | |
kube cp "$ff" "${po}:$di" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment