运行:kubectl apply -f k8s-tomcat7.yaml 

删除:kubectl delete -f k8s-tomcat7.yaml 

查看所有节点:kubectl get pods --all-namespaces -o wide

查看某个节点的情况:kubectl description tomcat7-deployment-87f87c9ff-mks5t get pods

查看日志:kubectl logs -n kube-system tomcat7-deployment-87f87c9ff-pswz8

查看k8s对外暴露的端口:

所有:kubectl get svc --all-namespaces,kubectl get svc -A

某个名空间的:kubectl get svc -n kube-system

编辑某个yaml文件:kubectl edit svc -n kube-system web-tomcat7

例如修改端口:

k8s常用命令

 

参考:https://www.cnblogs.com/jasonboren/p/11483405.html

相关文章:

猜你喜欢
  • 2021-09-02
  • 2021-09-05
  • 2021-05-17
相关资源
相似解决方案