Commit a2c9270e by wangtingwei

优化为相对路径

1 parent 5342d1b5
Showing with 9 additions and 9 deletions
#!/bin/bash #!/bin/bash
#wangtingwei #wangtingwei
#由于各个环境该目录不一致,所以执行此脚本前需要进入对应的项目目录,这里k8s_yaml是相对路径。不能写绝对路径。
IMAGE_NAME=`cat image_list.txt` #获取最新launcher镜像完整名字 IMAGE_NAME=`cat image_list.txt` #获取最新launcher镜像完整名字
PRI_IMAGE_NAME=`echo $IMAGE_NAME |awk -F '/' '{print $NF}'` #截断只保留镜像名字和tag部分 PRI_IMAGE_NAME=`echo $IMAGE_NAME |awk -F '/' '{print $NF}'` #截断只保留镜像名字和tag部分
date=`date +%F-%H-%M` date=`date +%F-%H-%M`
workspace=/workspace/seetaas
#################################################################### ####################################################################
kubectl get ns |grep volcano-system kubectl get ns |grep volcano-system
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
...@@ -20,8 +20,8 @@ sed -i s@IMAGE_NAME@$IMAGE_NAME@g /tmp/deployment-$date.yaml ...@@ -20,8 +20,8 @@ sed -i s@IMAGE_NAME@$IMAGE_NAME@g /tmp/deployment-$date.yaml
} }
#################################################################### ####################################################################
private_sed_image_name() { private_sed_image_name() {
cp -a $workspace/src/kpl-launcher/k8s_yaml/volcano/volcano-development.yaml /tmp/volcano-development-$date.yaml #拷贝到临时目录,sed不修改模板文件。这样就避免了sed修改出错的问题,不需要在recover sed cp -a k8s_yaml/volcano/volcano-development.yaml /tmp/volcano-development-$date.yaml #拷贝到临时目录,sed不修改模板文件。这样就避免了sed修改出错的问题,不需要在recover sed
cp -a $workspace/src/kpl-launcher/k8s_yaml/kpl-launcher/deployment.yaml /tmp/deployment-$date.yaml· cp -a k8s_yaml/kpl-launcher/deployment.yaml /tmp/deployment-$date.yaml·
sed -i s@hub.kce.ksyun.com/aivc/volcanosh/vc-scheduler:latest@harbor_host/k8s/vc-scheduler:latest@g /tmp/volcano-development-$date.yaml sed -i s@hub.kce.ksyun.com/aivc/volcanosh/vc-scheduler:latest@harbor_host/k8s/vc-scheduler:latest@g /tmp/volcano-development-$date.yaml
sed -i s@hub.kce.ksyun.com/aivc/volcanosh/vc-webhook-manager:latest@harbor_host/k8s/vc-webhook-manager:latest@g /tmp/volcano-development-$date.yaml sed -i s@hub.kce.ksyun.com/aivc/volcanosh/vc-webhook-manager:latest@harbor_host/k8s/vc-webhook-manager:latest@g /tmp/volcano-development-$date.yaml
...@@ -30,16 +30,16 @@ sed -i s@IMAGE_NAME@harbor_host/k8s/$PRI_IMAGE_NAME@g /tmp/deployment-$date.yaml ...@@ -30,16 +30,16 @@ sed -i s@IMAGE_NAME@harbor_host/k8s/$PRI_IMAGE_NAME@g /tmp/deployment-$date.yaml
} }
###################################################################### ######################################################################
delete_server () { delete_server () {
kubectl delete -f $workspace/src/kpl-launcher/k8s_yaml/kpl-ssl-configmap.yaml kubectl delete -f k8s_yaml/kpl-ssl-configmap.yaml
kubectl delete -f $workspace/src/kpl-launcher/k8s_yaml/kpl-ssl-configmap-autodl.yaml kubectl delete -f k8s_yaml/kpl-ssl-configmap-autodl.yaml
kubectl delete -f $workspace/src/kpl-launcher/k8s_yaml/volcano/ && sleep 2 kubectl delete -f k8s_yaml/volcano/ && sleep 2
kubectl delete -f $workspace/src/kpl-launcher/k8s_yaml/kpl-launcher/ && sleep 2 kubectl delete -f k8s_yaml/kpl-launcher/ && sleep 2
kubectl delete secrets -n volcano-system volcano-admission-secret kubectl delete secrets -n volcano-system volcano-admission-secret
} }
create_server () { create_server () {
kubectl apply -f $workspace/src/kpl-launcher/k8s_yaml/kpl-ssl-configmap.yaml kubectl apply -f k8s_yaml/kpl-ssl-configmap.yaml
kubectl apply -f $workspace/src/kpl-launcher/k8s_yaml/kpl-ssl-configmap-autodl.yaml kubectl apply -f k8s_yaml/kpl-ssl-configmap-autodl.yaml
kubectl apply -f /tmp/volcano-development-$date.yaml && sleep 3 #在/tmp目录下创建volcano和kpl-launcher服务 kubectl apply -f /tmp/volcano-development-$date.yaml && sleep 3 #在/tmp目录下创建volcano和kpl-launcher服务
kubectl apply -f /tmp/deployment-$date.yaml && sleep 3 kubectl apply -f /tmp/deployment-$date.yaml && sleep 3
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!