最近工作中使用到了k8s,那么就来总结下平时使用到的基本的命令
获取某个namespace下的pod获取某个namespace下的pod,展示出ip和pod信息查看节点控制台的日志获取某个namespace下的podkubectl get pods -n namespace
# kubectl get pods -n handlename READY STATUS RESTARTS AGEaccess-7754f795dd-f267n 1/1 Running 0 2d12haccount-78fc5f5bf4-xb96c 2d12hadmin-bd8d5f6bb-fkc4l 2d12hcores-77c5f6f696-k26hf 2d12hfile-7b94fb9fb7-m6x4v 2d12hhandle-55989bc69b-b2rp7 2d12hhandleapp-fddcf85b8-dn7t2 25dindex-5b87c9fd5b-q6htq 2d12hlog-statistics-8697f4987b-ptqn6 1 60dnotification-66b9ddd5c4-f2ktq 2d12hopen-74554f48-rclh6 2d12hsearch-7d469f95fb-r29rw 2d12hsequence-7d5bf65f9d-zt7xh 0 2d12h
获取某个namespace下的pod,展示出ip和pod信息
kubectl get pods --all-namespaces -o wIDe
# kubectl get pods -n handle -o wIDename READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READInesS GATESaccess-7754f795dd-f267n 0 2d12h 172.20.1.174 192.168.1.13 <none> <none>account-78fc5f5bf4-xb96c 1.179 admin-bd8d5f6bb-fkc4l 1.172 cores-77c5f6f696-k26hf 1.173 file-7b94fb9fb7-m6x4v 1.178 handle-55989bc69b-b2rp7 1.176 handleapp-fddcf85b8-dn7t2 0 25d 1.113 index-5b87c9fd5b-q6htq 2.27 1.12 <none> <none>log-statistics-8697f4987b-ptqn6 1 60d 0.72 1.11 <none> <none>notification-66b9ddd5c4-f2ktq 2.28 open-74554f48-rclh6 1.177 search-7d469f95fb-r29rw 1.180 sequence-7d5bf65f9d-zt7xh 1.175 1.13 <none> <none>
查看节点控制台的日志
kubectl logs -f POD-name -n namespace
# kubectl logs -f handle-55989bc69b-b2rp7 -n handle2020/01/10 21:06:45.667471 [INFO][dbcache] table: users,prefix: 9bc645.667911 [INFO][dbcache] table: settings,prefix: 2e5d45.742152 [INFO][handle-55989bc69b-b2rp7]["pkg.jimu.io/libs/util/version.go:24"] version: 680a3e245.746331 [INFO][handle-55989bc69b-b2rp7][pkg.jimu.io/libs/prometheus/prometheus.go:29"] Metrics Listening on :300145.788389 [INFO][handle-55989bc69b-b2rp7][pkg.jimu.io/vendor/github.com/teapots/teapot/app.go:130"] Teapot Listening on 0.0.0.0:80 in [prod] mode55.341161 [INFO][644c924b853ac088][680a3e2] [REQ_BEG] PUT handle.dev.jimu.io/enterprises/2650675
总结
以上是内存溢出为你收集整理的linux中 *** 作k8s的基本命令-更新中全部内容,希望文章能够帮你解决linux中 *** 作k8s的基本命令-更新中所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)