Skip to content

Commit 3b8399c

Browse files
authored
Merge pull request #25286 from keshy/patch-1
Updated Cheat sheet to include additional command to get shell access to a running pod
2 parents 742ad39 + f3107d2 commit 3b8399c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

content/en/docs/reference/kubectl/cheatsheet.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ kubectl run nginx --image=nginx # Run pod nginx and write it
311311
kubectl attach my-pod -i # Attach to Running Container
312312
kubectl port-forward my-pod 5000:6000 # Listen on port 5000 on the local machine and forward to port 6000 on my-pod
313313
kubectl exec my-pod -- ls / # Run command in existing pod (1 container case)
314+
kubectl exec --stdin --tty my-pod -- /bin/sh # Interactive shell access to a running pod (1 container case)
314315
kubectl exec my-pod -c my-container -- ls / # Run command in existing pod (multi-container case)
315316
kubectl top pod POD_NAME --containers # Show metrics for a given pod and its containers
316317
```

0 commit comments

Comments
 (0)