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 ...
随机推荐
- 【BLE】CC2541之发现服务与特征值
一.简介 本文以SimpleBLECentral工程为例,解析CC2541作为主机时是如何发现从机的服务和特征值的. 二.实验平台 协议栈版本:BLE-CC254x-1.4.0 编译软件:IAR 8. ...
- java 反射机制--根据属性名获取属性值
1.考虑安全访问范围内的属性,没有权限访问到的属性不读取 /** * 根据属性名获取属性值 * * @param fieldName * @param object * @return */ priv ...
- Android -- View流程
在自定义view中打log,view的显示共有三种,visible.invisible和gone,分别看一下log: gone onVisibilityChanged construct 2 para ...
- Android -- Canvas java.lang.UnsupportedOperationException
干货 java.lang.UnsupportedOperationException at android.view.GLES20Canvas.clipPath(GLES20Canvas.java:2 ...
- 【Scala】Scala-调用Java-集合
Scala-调用Java-集合 sacla 遍历 java list_百度搜索 13.11 Scala混用Java的集合类调用scala的foreach遍历问题 - 简书
- 【流处理】Kafka Stream-Spark Streaming-Storm流式计算框架比较选型
Kafka Stream-Spark Streaming-Storm流式计算框架比较选型 elasticsearch-head Elasticsearch-sql client NLPchina/el ...
- intel 汇编中断解释
汇编中的10H中断是由BIOS对显示器和屏幕所提供的服务程序.使用int 10h服务程序时,必须先指定ah寄存器为以下显示服务编号之一,以指定需要调用的功用. 显示服务 (Video Service: ...
- [Git] Undo my last commit and split it into two separate ones
When you accidentally committed some changes to your branch you have various possibilities to “undo” ...
- CodeForces 569B Inventory 货物编号
原题: http://codeforces.com/contest/569/problem/B 题目: Inventory time limit per test1 second memory lim ...
- GPUImage API 文档之GPUImageOutput类
GPUImageOutput类将静态图像纹理上传到OpenGL ES中,然后使用这些纹理去处理进程链中的下一个对象.它的子类可以获得滤镜处理后的图片功能.[本文讲的很少,由于有许多地方不清楚,以后会更 ...