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

  • 相关阅读:
    Leetcode 122. 买卖股票的最佳时机 II
    Leetcode 121. 买卖股票的最佳时机
    Leetcode 205. 同构字符串
    Leetcode 875. 爱吃香蕉的珂珂
    Leetcode 921. 使括号有效的最少添加
    Leetcode 238. 除自身以外数组的乘积
    评论设置----第二章:创建和管理内容
    其它内容选项----第二章:创建和管理内容
    预览和全展示----第二章:创建和管理内容
    Drupal的主题----第一章:Drupal的介绍
  • 原文地址:https://www.cnblogs.com/dalianpai/p/13733225.html
Copyright © 2011-2022 走看看