Merge pull request #26062 from notchairmk/cheatsheet_deploy_svc
Update cheatsheet: add interacting with Deployments and Services
This commit is contained in:
commit
203ad6d6a9
|
@ -320,6 +320,18 @@ kubectl top pod POD_NAME --containers # Show metrics for a given p
|
|||
kubectl top pod POD_NAME --sort-by=cpu # Show metrics for a given pod and sort it by 'cpu' or 'memory'
|
||||
```
|
||||
|
||||
## Interacting with Deployments and Services
|
||||
```bash
|
||||
kubectl logs deploy/my-deployment # dump Pod logs for a Deployment (single-container case)
|
||||
kubectl logs deploy/my-deployment -c my-container # dump Pod logs for a Deployment (multi-container case)
|
||||
|
||||
kubectl port-forward svc/my-service 5000 # listen on local port 5000 and forward to port 5000 on Service backend
|
||||
kubectl port-forward svc/my-service 5000:my-service-port # listen on local port 5000 and forward to Service target port with name <my-service-port>
|
||||
|
||||
kubectl port-forward deploy/my-deployment 5000:6000 # listen on local port 5000 and forward to port 6000 on a Pod created by <my-deployment>
|
||||
kubectl exec deploy/my-deployment -- ls # run command in first Pod and first container in Deployment (single- or multi-container cases)
|
||||
```
|
||||
|
||||
## Interacting with Nodes and cluster
|
||||
|
||||
```bash
|
||||
|
|
Loading…
Reference in New Issue