#!/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的更多相关文章

  1. 利用Shell脚本将MySQL表中的数据转化为json格式

    脚本如下: #!/bin/bash mysql -s -phello test >.log <<EOF desc t1; EOF lines="concat_ws(',', ...

  2. 通过Shell脚本读取properties文件中的参数时遇到\r换行符的问题

    今天在编写微服务程序启动脚本的时候,遇到一个比较奇葩的问题,下面给出具体描述: 目标:通过读取maven插件打包时生成的pom.properties文件,获取里面的应用名称和应用版本号,然后拼接得到s ...

  3. 利用shell脚本将Oracle服务器中数据定时增量刷新到ftp服务器中

    现有需求:将oracle数据库中的数据准实时同步至某ftp服务器中,以便前端应用能定时从ftp服务器目录中取增量数据 方法:将加工脚本写为存储过程,然后利用shell脚本执行该存储过程并将增量数据导出 ...

  4. shell脚本练习题(更新中...)

    练习题(这里贴的是自己写的代码, 网上给的题目代码我会附加在最下面) 1. 编写shell脚本,计算1-100的和: #!/bin/bash #caculate the to `; do sum=$[ ...

  5. (原创)Windows下编译的Shell脚本不能再Linux中运行的解决办法

    一.原理 Windows编译的文件和Linux编译的文件格式不太一样,导致在Linux运行Shell脚本的时候会提示:/bin/bash^M: bad interpreter: 没有那个文件或目录. ...

  6. centos使用shell脚本定时备份docker中的mysql数据库

    shell脚本 #!/bin/bash #容器ID container_id="6b1faea2b4d7" #登录用户名 mysql_user="root" # ...

  7. 常用shell脚本(持续更新中)

    1. 写一个shell脚本来得到当前的日期,时间,用户名和当前工作目录. 答案 : 输出用户名,当前日期和时间,以及当前工作目录的命令就是logname,date,who i am和pwd. #!/b ...

  8. shell 脚本sed替换文件中某个字符串

    有些大文件,特别的大.有几百兆,甚至更大. 用文本编辑器打开十分的费劲,电脑都卡死了. 想替换其中的字符串,很麻烦. 这个时候有了shell,简直强大到爆炸! # du -h user.sql 304 ...

  9. shell脚本从文件夹中递归提取文件

    需求 前两天碰到需要在十层左右的文件夹中提取文件的需求,于是写了此脚本. 如下面这样的文件结构: dir1 ├── a │ ├── b │ │ └── file1 │ └── file2 ├── c ...

随机推荐

  1. iOS开发文件夹--Copy items if needed

    蓝色文件夹 蓝色文件夹(folder)一般作为资源文件夹使用,与黄色文件夹的主要区别是不参与编译,所以说如果你在这些文件夹下编写的逻辑代码是不参与编译的,其他文件也不能直接引用它们,若引用其中文件需要 ...

  2. iOS开发-类簇(Class Cluster)

    类簇(Class  Cluster)是定义相同的接口并提供相同功能的一组类的集合,仅公开接口的抽象类也可以称之为类簇的公共类,每个具体类的接口有公共类的接口抽象化,并隐藏在簇的内部.这些类一般不能够直 ...

  3. 添加 Github follow、star按钮到网页

    怎么把github的star/fork/watch三个按钮弄到自己网站上? 就是这个按钮如何弄到我的网站里面来,是否有API呢?mdo/github-buttons · GitHub这个超级方便已经添 ...

  4. C++可变参数列表处理宏va_list、va_start、va_end的使用

      VA_LIST是在C语言中解决变参问题的一组宏他有这么几个成员: 1)va_list型变量: #ifdef     _M_ALPHA typedef    struct{ char* a0; /* ...

  5. 转:EM算法总结

    https://applenob.github.io/em.html EM算法总结 在概率模型中,最常用的模型参数估计方法应该就是最大似然法. EM算法本质上也是最大似然,它是针对模型中存在隐变量的情 ...

  6. NLP--自然语言处理与机器学习会议

    http://blog.csdn.net/ice110956/article/details/17090061 整理至11月中旬在重庆参加的自然语言处理与机器学习会议,第一讲为自然语言处理. 由基本理 ...

  7. JavaSE(十)之Map总结 (转)

    http://www.cnblogs.com/zhangyinhua/p/7545979.html 阅读目录(Content) 一.Map接口 1.1.为什么Collection不能满足集合的所有功能 ...

  8. [Algorithm] Delete a node from Binary Search Tree

    The solution for the problem can be divided into three cases: case 1: if the delete node is leaf nod ...

  9. 2012年5月阿里巴巴集团”去 IOE”运动的思考与总结【转载+整理】

    原文地址 什么是 IOE,IOE 只是一个简称,分别代表 IBM.Oracle.EMC,确切地说是 IBM 小型机.Oracle 数据库与 EMC 存储设备的组合.这"三驾马车"构 ...

  10. maven 配置篇 之pom.xml

    http://www.blogjava.net/zyl/archive/2006/12/30/91055.html http://maven.apache.org/pom.html的翻译.     m ...