zoukankan      html  css  js  c++  java
  • kubectl工具管理应用生命周期

    ######kubectl管理工具######

    [root@k8s-master dashboard]# kubectl get pod
    NAME                     READY     STATUS    RESTARTS   AGE
    nginx-64f497f8fd-jnhgm   1/1       Running   0          22h
    nginx-64f497f8fd-n5pst   1/1       Running   0          22h
    nginx-64f497f8fd-rzldm   1/1       Running   0          22h
    [root@k8s-master dashboard]# kubectl exec -it nginx-64f497f8fd-jnhgm bash   ######进入容器
    root@nginx-64f497f8fd-jnhgm:/# ls 
    bin   dev  home  lib64  mnt  proc  run   srv  tmp  var
    boot  etc  lib   media  opt  root  sbin  sys  usr
    
    [root@k8s-master dashboard]# kubectl logs nginx-64f497f8fd-jnhgm    ####查看容器日志
    192.168.56.244 - - [29/May/2019:10:33:45 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.29.0" "-"
    172.17.9.1 - - [29/May/2019:10:38:09 +0000] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36" "-"
    2019/05/29 10:38:09 [error] 5#5: *3 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 172.17.9.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "192.168.56.244:35824", referrer: "http://192.168.56.244:35824/"
    172.17.9.1 - - [29/May/2019:10:38:09 +0000] "GET /favicon.ico HTTP/1.1" 404 556 "http://192.168.56.244:35824/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36" "-"
    
    [root@k8s-master dashboard]# kubectl describe  po/nginx-64f497f8fd-n5pst     ####查看pod 容器的具体描述,可用于排错
  • 相关阅读:
    leetcode 203
    vim插件管理器vundle
    centos7看电影
    getopt
    iOS/object-c: 枚举类型 enum,NS_ENUM,NS_OPTIONS
    "ALView+PureLayout.h"
    UIPageViewController教程
    (Mac ox 10.11+) CocoaPods安装,卸载,使用说明
    CocoaPods集成到Xcode项目中的步骤
    label_设置行距、字距及计算含有行间距的label高度
  • 原文地址:https://www.cnblogs.com/shanhua-fu/p/10953541.html
Copyright © 2011-2022 走看看