#!/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. Three.js中如何显示帧速【转】

    https://blog.csdn.net/hannahlwh1988/article/details/36876295 Step1:src中添加: <script src="js/s ...

  2. 升级项目到Vs2010,编译时出现:MSB6006: “LC.exe”已退出,解决方法

    最近装了Vs2010 准备把一些项目,升级到.Net 4.0 在编译时,总是出现 MSB6006: “LC.exe”已退出 的错误.很是郁闷.刚开始以为是第三方控件的,去掉了,也不行.后来在网上找了一 ...

  3. JS读取XML文件数据并以table显示数据(兼容IE火狐)

    先看xml文件: <?xml version="1.0" standalone="yes"?> <student> <stuinf ...

  4. 解决ASP.NET页面回车回发的问题

    在asp.net页面中在文本框.按钮等服务器控件上回车都会导致页面回发,网上很多解决方案是使用JS来进行event.keyCode==13判断是否按下的回车键,如果是就event.returnValu ...

  5. 【大数据】基于Hadoop的HBase的安装(转)

    https://note.youdao.com/share/?id=c27485373a08517f7ad2e7ec901cd8d5&type=note#/ 安装前先确认HBse和Hadoop ...

  6. dubbo 提示No such extension Filter for filter/com.alibaba.dubbo.rpc.Filter

    配置时 <dubbo:provider filter="DubboExceptionFilter"></dubbo:provider> DubboExcep ...

  7. border-color: transparent rgb(255, 48, 48) transparent transparent;

    border-color: transparent rgb(255, 48, 48) transparent transparent;

  8. ArcGIS鼠标滚轮方向之注册表篇

    ArcMap鼠标滚轮方向的设置是记录在注册表信息中,那么我们做一个简单的测试.先打开注册表,将ReverseMouseWheel删除,再打开ArcMap进行鼠标滚轮方向设置. 设置完成后,刷新注册表, ...

  9. javascript高级语法学习

    可维护的代码意味着: 可读的 一致的 可预测的 看上去就像是同一个人写的 已记录 命名函数表达式 (function fn(){}) 他是表达式的原因是因为括号 ()是一个分组操作符,它的内部只能包含 ...

  10. .NET MVC中登陆授权过滤器的使用

    1.写个类LoginAuthorityAttribute,继承自AuthorizeAttribute using System; using System.Collections.Generic; u ...