-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: huaiyou <[email protected]>
- Loading branch information
Showing
9 changed files
with
77 additions
and
8 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key $@ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#! /bin/bash | ||
|
||
set -e | ||
|
||
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then | ||
echo "此脚本的入参为一个本地存在的docker镜像的tar包路径或者一个本地存在的docker镜像名" | ||
echo "此脚本会将传入的镜像tar包或者镜像名,转存到sealer registry当中" | ||
echo "Usage: $0 /root/image.tar #这是一个docker镜像save的tar包" | ||
echo " $0 image.tgz #这是对一个docker镜像save的tar包进行gzip压缩的包" | ||
echo " $0 nginx:latest #这是一个docker镜像名称" | ||
exit 0 | ||
fi | ||
|
||
split_image_name() { | ||
ImageUrl=$1 | ||
res="${ImageUrl//[^\/]}" | ||
PartNum=${#res} | ||
if [ ${PartNum} -eq 2 ];then | ||
Domain=$(echo $ImageUrl | cut -d'/' -f 2) | ||
Image=$(echo $ImageUrl | cut -d'/' -f 3) | ||
elif [ ${PartNum} -eq 1 ];then | ||
Domain=default | ||
Image=$(echo $ImageUrl | cut -d'/' -f 2) | ||
elif [ ${PartNum} -eq 0 ];then | ||
Domain=default | ||
Image=$ImageUrl | ||
fi | ||
} | ||
|
||
if echo "$1" | grep -q -E '\.tar$';then | ||
FullName=`docker load -i ${1} | cut -d' ' -f 3` | ||
elif echo "$1" | grep -q -E '\.tgz$';then | ||
image=`tar -xvf $1` | ||
FullName=`docker load -i ${image} | cut -d' ' -f 3` | ||
else | ||
FullName="$1" | ||
fi | ||
|
||
split_image_name $FullName | ||
|
||
for m in `kubectl get no -owide |grep master|awk '{print $6}'`;do | ||
docker tag $ImageUrl ${m}:5000/$Domain/$Image | ||
docker push ${m}:5000/$Domain/$Image | ||
done | ||
|
||
echo "已成功转存到 registry-internal.adp.aliyuncs.com:5000/$Domain/$Image" |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,6 @@ | |
|
||
### Kernel: | ||
|
||
- 4.18.* | ||
- 4.19.* | ||
- 3.10.* (must >=3.10.0-1160) | ||
|
||
|