K8S kubectl命令

一、kubectl命令

  1. 格式:kubectl [command] [type] [name] [flag]

    command:资源执行的操作,如create、get、delete;

    type:指定资源类型,如pod、service、deployment;

    name:指定资源名称;

    flags:额外可选参数;

  2. kubectl get

    A. 查看所有pod:kubectl get pod;

    B. 查看所有node:kubectl get node;

    C. 以json/yam形式l展示pod数据:kubectl get pod rhxy -o json/yaml;

    D. 查看pod的详细信息:kubectl get pod rhxy -o wide;

   3. 其他

    A. apply-新增和更新资源:kubectl apply -f rhxy.yml;

 

https://blog.csdn.net/qq_37304462/article/details/121346702

posted @ 2022-07-19 19:30  如幻行云  阅读(111)  评论(0编辑  收藏  举报