#!/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. Valid Sudoku leetcode java

    题目: Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could ...

  2. 配置Tomcat apr运行模式

    tomcat中一共有三种运行模式,分别是:bio,nio,apr bio是阻塞式IO操作,使用的是传统的java i/o处理方式,对于每一个请求都要创建一个线程来进行处理,所以开销较大不适合处理高并发 ...

  3. 双数组Trie树(DoubleArrayTrie)Java实现

    http://www.hankcs.com/program/java/%E5%8F%8C%E6%95%B0%E7%BB%84trie%E6%A0%91doublearraytriejava%E5%AE ...

  4. Excel长数字防止转换为科学计数法

    网上的一个方法是,加单引号,但是不好看. 我的处理,是先加,再替换成带格式的. strTable = Formater.SimpleTable(dt, "aaa", "| ...

  5. Chrome中的哪些端口是限制使用的?

      The following is a list of all of the restricted ports on Chrome: 1, // tcpmux 7, // echo 9, // di ...

  6. [Algorithm] Circular buffer

    You run an e-commerce website and want to record the last N order ids in a log. Implement a data str ...

  7. 准备Mahout所用的向量ApplesToVectors

    <strong><span style="font-size:18px;">/*** * @author YangXin * @info 准备Mahout所 ...

  8. .NET Framework System.Array.Sort 数组类,加深对 IComparer、IComparable 以及泛型委托、匿名方法、Lambda 表达式的理解

    本文内容 自定义类 Array.Sort 参考资料 System.Array.Sort 有很多对集合的操作,比如排序,查找,克隆等等,你可以利用这个类加深对 IComparer.IComparable ...

  9. setUserVisibleHint-- fragment真正的onResume和onPause方法

    现在越来越多的应用会使用viewpager+fragment显示自己的内容页,fragment和activity有很多共同点,如下图就是fragment的生命周期 但是fragment和activit ...

  10. 牛客网-《剑指offer》-从尾到头打印链表

    题目:http://www.nowcoder.com/practice/d0267f7f55b3412ba93bd35cfa8e8035 C++ /** * struct ListNode { * i ...