zoukankan      html  css  js  c++  java
  • k8s批量删除资源

    1. 查看有哪些不运行的pod
      image-20200926000641979

    2. 获取所有Evicted pod名称

    [root@k8s-master tmp]# kubectl get pod --all-namespaces | grep Evicted  | awk '{print $2}'
    gulimall-coupon-59595f8b8d-7sg5s
    gulimall-coupon-59595f8b8d-8bwqv
    gulimall-coupon-59595f8b8d-c6qk7
    gulimall-coupon-59595f8b8d-gblg2
    gulimall-coupon-59595f8b8d-hclst
    gulimall-coupon-59595f8b8d-k2nf8
    gulimall-coupon-59595f8b8d-klgr5
    gulimall-coupon-59595f8b8d-kwbrz
    gulimall-coupon-59595f8b8d-lrn26
    gulimall-coupon-59595f8b8d-lvccg
    gulimall-coupon-59595f8b8d-nswc9
    gulimall-coupon-59595f8b8d-ntjg7
    gulimall-coupon-59595f8b8d-pv8pr
    gulimall-coupon-59595f8b8d-qqk95
    gulimall-coupon-59595f8b8d-r8qs2
    gulimall-coupon-59595f8b8d-sfpdb
    gulimall-coupon-59595f8b8d-tqw6m
    gulimall-coupon-59595f8b8d-v9vmb
    gulimall-coupon-59595f8b8d-wvt7l
    gulimall-coupon-59595f8b8d-xmgkz
    gulimall-coupon-59595f8b8d-znv2l
    gulimall-gateway-c8888b668-p8zdx
    gulimall-order-7c4f596cfd-5d7vj
    gulimall-order-7c4f596cfd-7v8bw
    gulimall-order-7c4f596cfd-gc4kd
    gulimall-order-7c4f596cfd-ghxxc
    gulimall-order-7c4f596cfd-glmmb
    gulimall-order-7c4f596cfd-h4ckl
    gulimall-order-7c4f596cfd-l9fbk
    gulimall-order-7c4f596cfd-lgb5v
    gulimall-order-7c4f596cfd-x4q9z
    gulimall-order-7c4f596cfd-xf784
    gulimall-product-6dc475bd99-2k4v4
    gulimall-product-6dc475bd99-45vv8
    gulimall-product-6dc475bd99-4wjr4
    gulimall-product-6dc475bd99-5tqbh
    
    1. 删除pod
    [root@k8s-master tmp]# kubectl get pod --all-namespaces | grep Evicted  | awk '{print $2}' | xargs kubectl delete pod -n gulimall
    pod "gulimall-coupon-59595f8b8d-7sg5s" deleted
    pod "gulimall-coupon-59595f8b8d-8bwqv" deleted
    pod "gulimall-coupon-59595f8b8d-c6qk7" deleted
    pod "gulimall-coupon-59595f8b8d-gblg2" deleted
    pod "gulimall-coupon-59595f8b8d-hclst" deleted
    pod "gulimall-coupon-59595f8b8d-k2nf8" deleted
    pod "gulimall-coupon-59595f8b8d-klgr5" deleted
    pod "gulimall-coupon-59595f8b8d-kwbrz" deleted
    pod "gulimall-coupon-59595f8b8d-lrn26" deleted
    pod "gulimall-coupon-59595f8b8d-lvccg" deleted
    pod "gulimall-coupon-59595f8b8d-nswc9" deleted
    pod "gulimall-coupon-59595f8b8d-ntjg7" deleted
    pod "gulimall-coupon-59595f8b8d-pv8pr" deleted
    pod "gulimall-coupon-59595f8b8d-qqk95" deleted
    pod "gulimall-coupon-59595f8b8d-r8qs2" deleted
    pod "gulimall-coupon-59595f8b8d-sfpdb" deleted
    pod "gulimall-coupon-59595f8b8d-tqw6m" deleted
    pod "gulimall-coupon-59595f8b8d-v9vmb" deleted
    pod "gulimall-coupon-59595f8b8d-wvt7l" deleted
    pod "gulimall-coupon-59595f8b8d-xmgkz" deleted
    pod "gulimall-coupon-59595f8b8d-znv2l" deleted
    pod "gulimall-gateway-c8888b668-p8zdx" deleted
    pod "gulimall-order-7c4f596cfd-5d7vj" deleted
    pod "gulimall-order-7c4f596cfd-7v8bw" deleted
    pod "gulimall-order-7c4f596cfd-gc4kd" deleted
    pod "gulimall-order-7c4f596cfd-ghxxc" deleted
    pod "gulimall-order-7c4f596cfd-glmmb" deleted
    pod "gulimall-order-7c4f596cfd-h4ckl" deleted
    pod "gulimall-order-7c4f596cfd-l9fbk" deleted
    pod "gulimall-order-7c4f596cfd-lgb5v" deleted
    pod "gulimall-order-7c4f596cfd-x4q9z" deleted
    
    
    1. 查看pod

    image-20200926000800825

  • 相关阅读:
    PHP js使用ajax异步处理方式请求PHP,解决数组中文乱码
    PHP Apache服务配置
    opencv高斯背景建模
    Opencv,腐蚀,膨胀,轮廓检测,轮廓外接多边形
    opencv删除二值图中较小的噪点色块
    opencv图像操作
    opencv统计二值图黑白像素个数
    JAVA常用工具类
    Netty4 学习笔记之四: Netty HTTP服务的实现
    分享一些JAVA相关资源
  • 原文地址:https://www.cnblogs.com/dalianpai/p/13733225.html
Copyright © 2011-2022 走看看