1.项目目录介绍
1.1 脚本文件所在目录
1.2 项目启动文件所在目录
1.3 每个绿色文件夹下都又deployment.yaml文件
2.重启动脚本restart.sh
#!/bin/sh params=$1 echo 'params is '${params}'' tag=`ls chd-dev | awk -F":" '{if($1~/'${params}'/) print $1}'` tags=(${tag//\T/ }) i=-1; echo 'matched project '${tag}'' for var in ${tags[@]} do i=$[$i+1] echo ''${i}':'${var}'' done read -p "please select:" no ; pro=${tags[$no]} echo 'you select is:'${pro}'' path='chd-dev/'${pro}'/deployment.yaml' echo 'resource will be restart using file: '${path}'' kubectl delete -f $path kubectl create -f $path
3.日志查看脚本log.sh
#!/bin/sh params=$1 echo 'params is '${params}'' sh pd.sh | awk -F":" '{if($1~/'${params}'/) print $1}'| awk '{print $1}'|xargs kubectl --tail=600 -n energy-dev logs -f
4.查看namespace下pod的脚本pd.sh
kubectl get pod -n energy-dev