shell脚本逐个杀死k8s中某个应用的pod
#!/bin/bash pod01=`kubectl get pod -o wide -n weifeng-system|grep official-ui-node-prod|awk -F : 'NR==1'|awk -F " " '{print $1}'`
pod02=`kubectl get pod -o wide -n weifeng-system|grep official-ui-node-prod|awk -F : 'NR==2'|awk -F " " '{print $1}'`
pod03=`kubectl get pod -o wide -n weifeng-system|grep official-ui-node-prod|awk -F : 'NR==3'|awk -F " " '{print $1}'` kubectl delete pod $pod01 -n weifeng-system sleep 60 kubectl delete pod $pod02 -n weifeng-system sleep 60 kubectl delete pod $pod03 -n weifeng-system sleep 20 node_prod_status=`kubectl get pod -o wide -n weifeng-system|grep official-ui-node-prod|awk -F " " '{print $3}'|grep -ci "Running"` if [ $node_prod_status -eq 3 ];then echo -e "\033[32m[ the application official-ui-node-pre successfully deployed ]\033[0m" else
echo -e "\033[31m\033[01m[ the application official-ui-node-pre deploy failed ]\033[0m" fi
shell脚本逐个杀死k8s中某个应用的pod的更多相关文章
- 利用Shell脚本将MySQL表中的数据转化为json格式
脚本如下: #!/bin/bash mysql -s -phello test >.log <<EOF desc t1; EOF lines="concat_ws(',', ...
- 通过Shell脚本读取properties文件中的参数时遇到\r换行符的问题
今天在编写微服务程序启动脚本的时候,遇到一个比较奇葩的问题,下面给出具体描述: 目标:通过读取maven插件打包时生成的pom.properties文件,获取里面的应用名称和应用版本号,然后拼接得到s ...
- 利用shell脚本将Oracle服务器中数据定时增量刷新到ftp服务器中
现有需求:将oracle数据库中的数据准实时同步至某ftp服务器中,以便前端应用能定时从ftp服务器目录中取增量数据 方法:将加工脚本写为存储过程,然后利用shell脚本执行该存储过程并将增量数据导出 ...
- shell脚本练习题(更新中...)
练习题(这里贴的是自己写的代码, 网上给的题目代码我会附加在最下面) 1. 编写shell脚本,计算1-100的和: #!/bin/bash #caculate the to `; do sum=$[ ...
- (原创)Windows下编译的Shell脚本不能再Linux中运行的解决办法
一.原理 Windows编译的文件和Linux编译的文件格式不太一样,导致在Linux运行Shell脚本的时候会提示:/bin/bash^M: bad interpreter: 没有那个文件或目录. ...
- centos使用shell脚本定时备份docker中的mysql数据库
shell脚本 #!/bin/bash #容器ID container_id="6b1faea2b4d7" #登录用户名 mysql_user="root" # ...
- 常用shell脚本(持续更新中)
1. 写一个shell脚本来得到当前的日期,时间,用户名和当前工作目录. 答案 : 输出用户名,当前日期和时间,以及当前工作目录的命令就是logname,date,who i am和pwd. #!/b ...
- shell 脚本sed替换文件中某个字符串
有些大文件,特别的大.有几百兆,甚至更大. 用文本编辑器打开十分的费劲,电脑都卡死了. 想替换其中的字符串,很麻烦. 这个时候有了shell,简直强大到爆炸! # du -h user.sql 304 ...
- shell脚本从文件夹中递归提取文件
需求 前两天碰到需要在十层左右的文件夹中提取文件的需求,于是写了此脚本. 如下面这样的文件结构: dir1 ├── a │ ├── b │ │ └── file1 │ └── file2 ├── c ...
随机推荐
- JS条件判断
JavaScript 是一种可以在浏览器中运行的脚本语言,是一种弱语言(相对于C,C#,JAVA而言),只要是计算机语言就会使用到条件判断式,而JavaScript作为一种“弱”语言,它的条件判断常常 ...
- js改变iframe 的src地址
<script> function dizhi(){ document.getElementById("aaa").src='http://www.sohu.com' ...
- 对Kalman(卡尔曼)滤波器的理解@@zz
1.简介(Brief Introduction) 在学习卡尔曼滤波器之前,首先看看为什么叫“卡尔曼”.跟其他著名的理论(例如傅立叶变换,泰勒级数等等)一样,卡尔曼也是一个人的名字,而跟他们不同的是,他 ...
- 用Maven构建单机Mahout项目
Hadoop家族系列文章,主要介绍Hadoop家族产品,常用的项目包括Hadoop, Hive, Pig, HBase, Sqoop, Mahout, Zookeeper, Avro, Ambari, ...
- Eclipse版本控制Git不能Pull或者Push
如下图,addWcLesson.jsp做了修改,但是却显示蓝色√,而且在Eclipse的Git提交插件中也没有监测到修改的文件,导致无法Push and Commit 原因:之前有些文件执行了 ...
- scp ssh: connect to host 9.123.159.41 port 22:connection refused的解决办法
不同机器之间的文件拷贝,可以用scp命令 使用时报:ssh:connect to host 192.16.41.121 port 22:connectionrefused mac 无法ssh loca ...
- 在javascript中substr和substring的区别是什么
1.substring 用于提取字符串中介于两个指定下标之间的字符 substring(start,end) 开始和结束的位置,从零开始的索引 substring 方法返回的子串包括 start ...
- Java集合遍历时删除
public static void main(String[] args){ List<Integer> list = new ArrayList<Integer>(); l ...
- artTemplate 简洁语法版
引用简洁语法的引擎版本,例如: <script src="dist/template.js"></script> 下载 表达式 {{ 与 }} 符号包裹起来 ...
- 基于webview的选择滑动控件(PC和wap版)
有了webview,大家开发ios或者安卓的app就方便很多啦. 第一可以增量更新: 第二webview可以同时兼容ios和安卓,减少开发量哦. --------------------------- ...