cka真题之提取pod中的日志到指定文件
Monitor the logs of podbarand:Extract log lines corresponding to errorunable-to-access-websiteWrite them to/opt/KUTR00101/barroot@lijian:~/k8s# cd /opt/root@lijian:/opt# lltotal 20drwxr-xr-x 5 root ro
Monitor the logs of pod bar and:
Extract log lines corresponding to error unable-to-access-website
Write them to /opt/KUTR00101/bar
root@lijian:~/k8s# cd /opt/
root@lijian:/opt# ll
total 20
drwxr-xr-x 5 root root 4096 Feb 15 22:09 ./
drwxr-xr-x 24 root root 4096 Feb 9 22:41 ../
drwxr-xr-x 3 root root 4096 Feb 11 22:02 cni/
drwx--x--x 4 root root 4096 Feb 11 22:12 containerd/
drwxr-xr-x 2 root root 4096 Feb 15 22:09 KUSC00402/
root@lijian:/opt# mkdir KUTR00101
root@lijian:/opt# cd KUTR00101/
root@lijian:/opt/KUTR00101# touch foobar
root@lijian:/opt/KUTR00101# pwd
/opt/KUTR00101
root@lijian:/opt/KUTR00101# kubectl logs web-server | grep unable-access-website > /opt/KUTR00101/foobar
更多推荐
所有评论(0)