惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
量子位
月光博客
月光博客
人人都是产品经理
人人都是产品经理
U
Unit 42
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
H
Help Net Security
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
MyScale Blog
MyScale Blog
美团技术团队
P
Proofpoint News Feed
Apple Machine Learning Research
Apple Machine Learning Research
D
Docker
B
Blog
大猫的无限游戏
大猫的无限游戏
V
Visual Studio Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog

博客园 - 黑米

卸载 nodejs 时报错 you must be an administrator to remove this application 的解决 真心觉得,WIN11就是一个笑话 为 centos7 编译 nginx rabbitmqctl set_permissions 报错 invalid command centos7 升级 openssh (用来避坑) 你见过最长的类名是什么 记一次 k8s master 节点被 reset 后恢复的过程 java.lang.UnsupportedOperationException: null 解决 calico/node is not ready: BIRD is not ready: BGP not established with 的问题 @Transactional 和 @DSTransactional 混用可能会造成事务死锁 问题解决:idea 中无法连接 sql server 数据库,报错 [08S01] 驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接 java 里的正则表达式 为何实现了 Filter 的类,能自动添加到 filterChain 中? 如何正确填写 sonar.java.binaries 解决 Tasks support was removed in SonarQube 7.6. 的问题 部署了 prometheus, 在 target 中显示 cadvisor 与 nodes 的状态都是 down k8s 部署了 redis 集群,节点重启后,ip 变化导致集群不可用的问题 mvn deploy 到 nexus,报错 Return code is: 400, ReasonPhrase: Bad Request 关于 mybatis 的 @MapperScan 用法心得
用一个脚本定时清理被驱逐的pod
黑米 · 2022-03-17 · via 博客园 - 黑米

参考清理脚本

#!/bin/bash
# used to clear pods with evicted status

kubectl get ns | sed '1d' | awk '{print $1}' | while read NS; do
    # echo "NS=$NS"
    kubectl get pod -n $NS | grep -i evicted > /dev/null 2>&1
    if [ $? -eq 0 ]; then
        # echo "NS=$NS; ############# "
        kubectl get pod -n $NS | grep -i evicted | awk '{print $1}' | while read POD
        do
            echo "NS=$NS; POD=$POD"
            kubectl -n $NS delete pod $POD 
        done
    fi

done

然后把它加入到定时任务中执行即可。

posted on 2022-03-17 11:47  黑米  阅读(231)  评论(0)    收藏  举报