zoukankan      html  css  js  c++  java
  • kubectl exec 执行 容器命令

    格式如下:
    kubectl exec -it podName  -c  containerName -n namespace -- shell comand
    
    1 创建目录
    kubectl exec -it spark-master-xksl -c spark-master -n spark  -- mkdir -p /usr/local/spark   
    
    注意:
    shell命令前,要加-- 号,不然shell命令中的参数,不能识别
    
    
    实例配置:
    
    查看pod 的 日志 
    
    
    [root@k8s-hd-master03 ~]# kubectl exec -it $(kubectl get pod -n zhiyi-system-test|grep "ai-live-dev"|awk '{print $1}')    -n zhiyi-system-test --  tail -f /home/ailive-logs/gray/ailive_dao.2019-05-16.log
    
    2019-05-16 11:50:53 DEBUG [c.z.a.d.m.k.U.getUserPage] <==      Total: 5
    2019-05-16 11:50:53 DEBUG [c.z.a.d.m.k.U.listByExample] ==>  Preparing: select a.id, a.user_id, a.team_id, a.streamer_id, a.remark, a.organization, a.created_at, a.updated_at from ( select a.id, a.user_id, a.team_id, a.streamer_id, a.remark, a.organization, a.created_at, a.updated_at from ks_user_remark a WHERE a.team_id = ? and a.streamer_id in ( ? , ? , ? , ? , ? ) order by a.updated_at desc, a.id ) a group by a.streamer_id 
    2019-05-16 11:50:53 DEBUG [c.z.a.d.m.k.U.listByExample] ==> Parameters: 251810(Integer), 50204684(Long), 6646803(Long), 156587032(Long), 188888880(Long), 228158199(Long)
    2019-05-16 11:50:53 DEBUG [c.z.a.d.m.k.U.listByExample] <==      Total: 0
    2019-05-16 11:50:53 DEBUG [c.z.a.d.m.k.U.listByExample] ==>  Preparing: select a.id, a.user_id, a.team_id, a.streamer_id, a.`status`, a.created_at, a.updated_at from ks_user_collect a WHERE a.user_id = ? and a.streamer_id in ( ? , ? , ? , ? , ? ) and a.`status` = ? order by a.updated_at desc 
    2019-05-16 11:50:53 DEBUG [c.z.a.d.m.k.U.listByExample] ==> Parameters: 151810(Integer), 50204684(Long), 6646803(Long), 156587032(Long), 188888880(Long), 228158199(Long), 1(Integer)
    2019-05-16 11:50:53 DEBUG [c.z.a.d.m.k.U.listByExample] <==      Total: 5
    2019-05-16 11:50:53 DEBUG [c.z.a.d.m.t.T.listByCategoryIdList] ==>  Preparing: select id, category_id, category_name, parent_cid, parent_category_name, `desc`, `level`, is_leaf, created_at, updated_at from taobao_category_map WHERE category_id in ( ? , ? , ? , ? , ? ) 
    2019-05-16 11:50:53 DEBUG [c.z.a.d.m.t.T.listByCategoryIdList] ==> Parameters: 50013099(Integer), 50010535(Integer), 50016845(Integer), 50018977(Integer), 50010817(Integer)
    

      

  • 相关阅读:
    编程之美1的个数统计
    组合以及可以重复的排列
    Swing之图书管理系统
    经常熬夜的人一定要看
    利用SharePoint Designer开发可循环工作流
    SharePoint Software DownLoad Address 微软软件 下载地址
    日期验证 正则表达式
    时间验证 正则表达式
    Reporting Services SharePoint AddIn Setup Problems
    char、varchar、text和nchar、nvarchar、ntext的区别
  • 原文地址:https://www.cnblogs.com/weifeng1463/p/10875332.html
Copyright © 2011-2022 走看看