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

  • 相关阅读:
    DVWA 黑客攻防演练(十)反射型 XSS 攻击 Reflected Cross Site Scripting
    DVWA 黑客攻防演练(九) SQL 盲注 SQL Injection (Blind)
    DVWA 黑客攻防演练(八)SQL 注入 SQL Injection
    DVWA 黑客攻防演练(七)Weak Session IDs
    DVWA 黑客攻防演练(六)不安全的验证码 Insecure CAPTCHA
    DVWA 黑客攻防演练(五)文件上传漏洞 File Upload
    工作流表结构设计
    Visual Studio 2019尝鲜----新建空项目体验
    《使用CSLA 2019:CSLA .NET概述》原版和机译文档下载
    .NET快速开发平台的在线预览
  • 原文地址:https://www.cnblogs.com/dalianpai/p/13733225.html
Copyright © 2011-2022 走看看