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 

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐