Skip to content

Commit 622e5f9

Browse files
authored
update latest kubectl run syntax
--dry-run is deprecated `--restart=Never` flag is unnecessary to create a pod from 1.18
1 parent 0e90457 commit 622e5f9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,10 @@ kubectl logs -f my-pod # stream pod logs (stdout)
290290
kubectl logs -f my-pod -c my-container # stream pod container logs (stdout, multi-container case)
291291
kubectl logs -f -l name=myLabel --all-containers # stream all pods logs with label name=myLabel (stdout)
292292
kubectl run -i --tty busybox --image=busybox -- sh # Run pod as interactive shell
293-
kubectl run nginx --image=nginx --restart=Never -n
293+
kubectl run nginx --image=nginx -n
294294
mynamespace # Run pod nginx in a specific namespace
295-
kubectl run nginx --image=nginx --restart=Never # Run pod nginx and write its spec into a file called pod.yaml
296-
--dry-run -o yaml > pod.yaml
295+
kubectl run nginx --image=nginx # Run pod nginx and write its spec into a file called pod.yaml
296+
--dry-run=client -o yaml > pod.yaml
297297

298298
kubectl attach my-pod -i # Attach to Running Container
299299
kubectl port-forward my-pod 5000:6000 # Listen on port 5000 on the local machine and forward to port 6000 on my-pod

0 commit comments

Comments
 (0)