Commit 367f9b00 by tingweiwang

add annotion脚本注释&& review

1 parent 21474a74
Showing with 8 additions and 8 deletions
#!/bin/bash #!/bin/bash
#wangtingwei #wangtingwei
IMAGE_NAME=`cat image_list.txt` IMAGE_NAME=`cat image_list.txt` #获取最新launcher镜像完整名字
PRI_IMAGE_NAME=`echo $IMAGE_NAME |awk -F '/' '{print $3}'` PRI_IMAGE_NAME=`echo $IMAGE_NAME |awk -F '/' '{print $3}'` #截断只保留镜像名字和tag部分
################################ ####################################################################
kubectl get ns |grep volcano-system kubectl get ns |grep volcano-system
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "volcano-system namespace already exit,continue operation" echo "volcano-system namespace already exit,continue operation"
else else
echo "namespace not found, autocreate namespace volcano-system" && kubectl create namespace volcano-system echo "namespace not found, autocreate namespace volcano-system" && kubectl create namespace volcano-system
fi fi
############################################# ####################################################################
sed_image_name () { sed_image_name () {
echo "#sed image name##" echo "###############sed修改部署在公有环境的镜像名字#####################"
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 "################恢复launcher镜像模板###########################"
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() { 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-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-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@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` 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
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!