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

  • 相关阅读:
    Codeforces Beta Round #92 (Div. 2 Only) B. Permutations 模拟
    POJ 3281 Dining 最大流 Dinic算法
    POJ 2441 Arrange the BUlls 状压DP
    URAL 1152 Faise Mirrors 状压DP 简单题
    URAL 1039 Anniversary Party 树形DP 水题
    URAL 1018 Binary Apple Tree 树形DP 好题 经典
    pytorch中的forward前向传播机制
    .data()与.detach()的区别
    Argparse模块
    pytorch代码调试工具
  • 原文地址:https://www.cnblogs.com/dalianpai/p/13733225.html
Copyright © 2011-2022 走看看