File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
content/en/docs/reference/kubectl Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -320,6 +320,18 @@ kubectl top pod POD_NAME --containers # Show metrics for a given p
320
320
kubectl top pod POD_NAME --sort-by=cpu # Show metrics for a given pod and sort it by 'cpu' or 'memory'
321
321
```
322
322
323
+ ## Interacting with Deployments and Services
324
+ ``` bash
325
+ kubectl logs deploy/my-deployment # dump Pod logs for a Deployment (single-container case)
326
+ kubectl logs deploy/my-deployment -c my-container # dump Pod logs for a Deployment (multi-container case)
327
+
328
+ kubectl port-forward svc/my-service 5000 # listen on local port 5000 and forward to port 5000 on Service backend
329
+ 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>
330
+
331
+ 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>
332
+ kubectl exec deploy/my-deployment -- ls # run command in first Pod and first container in Deployment (single- or multi-container cases)
333
+ ```
334
+
323
335
## Interacting with Nodes and cluster
324
336
325
337
``` bash
You can’t perform that action at this time.
0 commit comments