pods
1 | $ kubectl get pods -n pro |
不用grep列出node上的pod
1 | kubectl get pods --field-selector spec.nodeName=node04 --all-namespaces |
POD升级和历史
列出部署历史记录1
$ kubectl rollout history deployment/DEPLOYMENT_NAME
跳转到特定修订版1
$ kubectl rollout undo deployment/DEPLOYMENT_NAME --to-revision=N
service
查看服务1
$ kubectl get services
将POD作为服务公开(创建端点)1
$ kubectl expose deployment/aa --port=2000 --type=NodePort
login
1 | kubectl exec -ti 1 bash -n product |
log
1 | kubectl logs -f 1 -n product |