Commit e04a72e7 by tingweiwang

improve 私有镜像模板

1 parent 3aea80d4
Showing with 17 additions and 4 deletions
#!/bin/bash #!/bin/bash
#wangtingwei #wangtingwei
IMAGE_NAME=`cat image_list.txt` IMAGE_NAME=`cat image_list.txt`
PRI_IMAGE_NAME=`echo $IMAGE_NAME |awk -F '/' '{print $3}'`
################################ ################################
kubectl get ns |grep volcano-system kubectl get ns |grep volcano-system
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
...@@ -19,12 +20,19 @@ echo "#sed image name##" ...@@ -19,12 +20,19 @@ echo "#sed image name##"
sleep 2 sleep 2
sed -i s@IMAGE_NAME@$IMAGE_NAME@g k8s_yaml/kpl-launcher/deployment.yaml sed -i s@IMAGE_NAME@$IMAGE_NAME@g k8s_yaml/kpl-launcher/deployment.yaml
} }
recover_image_name () { recover_image_name () {
echo "##recover image name model##" echo "##recover image name model##"
sleep 2 sleep 2
sed -i s@$IMAGE_NAME@IMAGE_NAME@g k8s_yaml/kpl-launcher/deployment.yaml sed -i s@$IMAGE_NAME@IMAGE_NAME@g k8s_yaml/kpl-launcher/deployment.yaml
} }
private_sed_image_name() {
sed -i s@hub.kce.ksyun.com/aivc/volcanosh/vc-scheduler:latest@$harbor_host/k8s/vc-scheduler:latest@g `find $workspace -maxdepth 5 -name Dockerfile -type f`
sed -i s@hub.kce.ksyun.com/aivc/volcanosh/vc-webhook-manager:latest@$harbor_host/k8s/vc-webhook-manager:latest@g `find $workspace -maxdepth 5 -name Dockerfile -type f`
sed -i s@hub.kce.ksyun.com/aivc/volcanosh/vc-controller-manager:latest@$harbor_host/k8s/vc-controller-manager:latest@g `find $workspace -maxdepth 5 -name Dockerfile -type f`
sed -i s@IMAGE_NAME@$harbor_host/k8s/PRI_IMAGE_NAME@g `find $workspace -maxdepth 5 -name Dockerfile -type f`
}
delete_server () { delete_server () {
kubectl delete -f k8s_yaml/kpl-ssl-configmap.yaml kubectl delete -f k8s_yaml/kpl-ssl-configmap.yaml
kubectl delete -f k8s_yaml/kpl-ssl-configmap-autodl.yaml kubectl delete -f k8s_yaml/kpl-ssl-configmap-autodl.yaml
...@@ -47,16 +55,21 @@ create_server ...@@ -47,16 +55,21 @@ create_server
recover_image_name recover_image_name
} }
private_deploy () {
delete_server
private_sed_image_name
create_server
}
case $1 in case $1 in
redeploy_all) redeploy_all)
redeploy_all redeploy_all
;; ;;
update) private_deploy)
update private_deploy
;; ;;
*) *)
echo "please input (redeploy_all or update)" echo "please input (redeploy_all or private_deploy)"
esac esac
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!