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