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 容器的具体描述,可用于排错