Commit b7b9957b by tingweiwang

废弃nfs模板恢复,在nfs server为u同一个时候,恢复会出现bug,采用模板复制到tmp目录。修改tmp目录的文件。

1 parent 90013928
Showing with 16 additions and 15 deletions
......@@ -457,21 +457,22 @@ echo "隸キ謇句勘蝨ィmaster闃らせ 隶セ鄂ョ蜻ス莉、閾ェ蜉ィ陦・蜈ィ悟多莉、蝨ィ閼壽悽譛蜷惹
echo "为gpu节点打标签"
kubectl label node $host_name autodl=true kpl=true gpu=true cpu=true user_job_node=true internal_service_node=true
echo "###################创建pv pvc#############"
cp -arf /root/k8s/autodl_kpl_base/ /tmp/
echo "########################修改pv模板#######################" && sleep 3
sed -i s@NFS_PATH@$NFS_PATH@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
sed -i s@NFS_2_PATH@$NFS_2_PATH@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
sed -i s@NFS_3_PATH@$NFS_3_PATH@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
sed -i s@NFS_SERVER@$NFS_SERVER@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
sed -i s@NFS_2_SERVER@$NFS_2_SERVER@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
sed -i s@NFS_3_SERVER@$NFS_3_SERVER@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
kubectl apply -f /root/k8s/autodl_kpl_base/autodl-nfs
kubectl apply -f /root/k8s/autodl_kpl_base/kpl-nfs
echo "###################还原pv pvc模板配置#############" && sleep 2
sed -i s@$NFS_PATH@NFS_PATH@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
sed -i s@$NFS_2_PATH@NFS_2_PATH@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
sed -i s@$NFS_3_PATH@NFS_3_PATH@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
sed -i s@$NFS_SERVER@NFS_SERVER@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
sed -i s@$NFS_2_SERVER@NFS_2_SERVER@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
sed -i s@$NFS_3_SERVER@NFS_3_SERVER@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
sed -i s@NFS_PATH@$NFS_PATH@g `find /tmp/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
sed -i s@NFS_2_PATH@$NFS_2_PATH@g `find /tmp/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
sed -i s@NFS_3_PATH@$NFS_3_PATH@g `find /tmp/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
sed -i s@NFS_SERVER@$NFS_SERVER@g `find /tmp/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
sed -i s@NFS_2_SERVER@$NFS_2_SERVER@g `find /tmp/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
sed -i s@NFS_3_SERVER@$NFS_3_SERVER@g `find /tmp/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
kubectl apply -f /tmp/autodl_kpl_base/autodl-nfs
kubectl apply -f /tmp/autodl_kpl_base/kpl-nfs
#echo "###################还原pv pvc模板配置#############" && sleep 2
#sed -i s@$NFS_PATH@NFS_PATH@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
#sed -i s@$NFS_2_PATH@NFS_2_PATH@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
#sed -i s@$NFS_3_PATH@NFS_3_PATH@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
#sed -i s@$NFS_SERVER@NFS_SERVER@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
#sed -i s@$NFS_2_SERVER@NFS_2_SERVER@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
#sed -i s@$NFS_3_SERVER@NFS_3_SERVER@g `find /root/k8s/autodl_kpl_base/ -maxdepth 2 -name "*.yaml" -type f`
echo "创建autodl push 镜像所需secret证书,用于configmap"
sh /root/k8s/autodl_kpl_base/create-harbor-secret.sh
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!