LFS258-LAB-Logging and Troubleshooting

Log文件位置

  1. 基于systemd运行的程序
student@ubuntu:~/schedule$sudo journalctl -u kubelet
-- Logs begin at Wed 2018-12-05 19:06:59 CST, end at Thu 2018-12-06 13:59:49 CST. --
Dec 05 19:07:00 ubuntu systemd[1]: Started kubelet: The Kubernetes Node Agent.
Dec 05 19:07:01 ubuntu kubelet[1012]: Flag --cgroup-driver has been deprecated, This parameter should be set via the
Dec 05 19:07:01 ubuntu kubelet[1012]: Flag --cgroup-driver has been deprecated, This parameter should be set via the
Dec 05 19:07:01 ubuntu kubelet[1012]: I1205 19:07:01.538355    1012 server.go:408] Version: v1.12.1
Dec 05 19:07:01 ubuntu kubelet[1012]: I1205 19:07:01.539158    1012 plugins.go:99] No cloud provider specified.
Dec 05 19:07:01 ubuntu kubelet[1012]: I1205 19:07:01.553207    1012 certificate_store.go:131] Loading cert/key pair 
Dec 05 19:07:04 ubuntu kubelet[1012]: I1205 19:07:04.246999    1012 ser

2.基于容器运行程序的日志

student@ubuntu:~/schedule$sudo ls -l /var/log/pods/
total 68
drwxr-xr-x 3 root root 4096 Nov 28 17:32 02f34b8bdf4183e01c93f1fd42a45181
drwxr-xr-x 3 root root 4096 Nov 28 17:32 183f614c7ab779865ab2702280309e20
drwxr-xr-x 3 root root 4096 Nov 29 15:26 23c899a0-f3a8-11e8-9072-52540066b534
drwxr-xr-x 3 root root 4096 Nov 28 17:23 2ed2650c7a7589a204b97dae99f24ef3
drwxr-xr-x 3 root root 4096 Dec  6 13:53 332a4100-f91b-11e8-acde-52540066b534
drwxr-xr-x 3 root root 4096 Dec  6 13:53 33301006-f91b-11e8-acde-52540066b534

student@ubuntu:~/schedule$sudo find /var/log/pods/  -name *kube-api*
/var/log/pods/02f34b8bdf4183e01c93f1fd42a45181/kube-apiserver
student@ubuntu:~/schedule$sudo ls -l /var/log/pods/02f34b8bdf4183e01c93f1fd42a45181/kube-apiserver/
4.log  5.log  
student@ubuntu:~/schedule$sudo ls -l /var/log/pods/02f34b8bdf4183e01c93f1fd42a45181/kube-apiserver/4.log

查看程序日志的输出

student@ubuntu:~/schedule$kubectl -n kube-system  logs -f kube-apiserver-ubuntu 
Flag --insecure-port has been deprecated, This flag will be removed in a future version.
I1205 11:14:28.166921       1 server.go:681] external host was not specified, using 172.30.81.194
I1205 11:14:28.167750       1 server.go:152] Version: v1.12.1
I1205 11:14:29.238212       1 plugins.go:158] Loaded 8 mutating admission controller(s) successfully in the following order: NamespaceLifecycle,LimitRanger,ServiceAccount,NodeRestriction,Priority,DefaultTolerationSeconds,

你可能感兴趣的:(LFS258-LAB-Logging and Troubleshooting)