K8s常用命令

获取pod和服务ip
kubectl get pod -n <ns> -o wide

获取所有node
kubectl get node --show-labels

查看服务日志
kubectl logs -f -n <ns>  <pod>


kubectl logs -f --tail=500 -n <ns>  <pod>


kubectl logs -f --since 5m -n <ns>  <pod>


kubectl logs -f -n <ns>  <pod> | grep error


进入服务执行命令
kubectl exec -it  <pod>  -- service memcache restart

进入pod
kubectl exec -it  <pod> -n <ns> -- sh 


nginx重新载入
kubectl exec -it -n <ns> <pod> -- nginx -s reload


删除服务(自动重启)
kubectl -n <ns> delete pod <pod>


查看pod服务信息
kubectl describe  -n <ns> pod  <pode>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值