Skip to content

Commit

Permalink
add docker mirror
Browse files Browse the repository at this point in the history
Signed-off-by: cwen0 <[email protected]>
  • Loading branch information
cwen0 committed Mar 2, 2020
1 parent 5ca52b9 commit b25e4f5
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
41 changes: 40 additions & 1 deletion examples/web-show/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,50 @@

set -e

usage() {
cat << EOF
This script is used to install wob-show.
USAGE:
install.sh [FLAGS] [OPTIONS]
FLAGS:
-h, --help Prints help information
--docker-mirror Use docker mirror to pull image
EOF
}

DOCKER_MIRROR=false

while [[ $# -gt 0 ]]
do
key="$1"

case $key in
--docker-mirror)
DOCKER_MIRROR=true
shift
;;
-h|--help)
usage
exit 0
;;
*)
echo "unknown option: $key"
usage
exit 1
;;
esac
done

TARGET_IP=$(kubectl get pod -n kube-system -o wide| grep kube-controller | head -n 1 | awk '{print $6}')

sed "s/TARGETIP/$TARGET_IP/g" deployment.yaml > deployment-target.yaml

docker pull
if [ ${DOCKER_MIRROR} == "true" ]; then
docker pull dockerhub.azk8s.cn/pingcap/web-show || true
docker tag dockerhub.azk8s.cn/pingcap/web-show pingcap/web-show || true
kind load docker-image pingcap/web-show > /dev/null 2>&1 || true
fi

kubectl apply -f service.yaml
kubectl apply -f deployment-target.yaml

Expand Down
2 changes: 1 addition & 1 deletion examples/web-show/network-delay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ spec:
jitter: "0ms"
duration: "30s"
scheduler:
cron: "@every 60s"
cron: "@every 60s"
2 changes: 1 addition & 1 deletion examples/web-show/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ spec:
ports:
- protocol: TCP
port: 8081
targetPort: 8081
targetPort: 8081

0 comments on commit b25e4f5

Please sign in to comment.