Update cheatsheet.md

It's wrong to say "Run pod nginx" along with the spec being written to the file as the option --dry-run would make sure that the actual executing is not happening but only the preview is generated

The statement would have been correct if the command were something like ...
kubectl run nginx --image=nginx -o yaml > pod.yaml
This commit is contained in:
Swadhin Patel 2022-08-05 18:22:20 +08:00 committed by GitHub
parent 4762c8d95c
commit e343b36d72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -336,7 +336,7 @@ kubectl logs -f my-pod -c my-container # stream pod container logs
kubectl logs -f -l name=myLabel --all-containers # stream all pods logs with label name=myLabel (stdout) kubectl logs -f -l name=myLabel --all-containers # stream all pods logs with label name=myLabel (stdout)
kubectl run -i --tty busybox --image=busybox:1.28 -- sh # Run pod as interactive shell kubectl run -i --tty busybox --image=busybox:1.28 -- sh # Run pod as interactive shell
kubectl run nginx --image=nginx -n mynamespace # Start a single instance of nginx pod in the namespace of mynamespace kubectl run nginx --image=nginx -n mynamespace # Start a single instance of nginx pod in the namespace of mynamespace
kubectl run nginx --image=nginx # Run pod nginx and write its spec into a file called pod.yaml kubectl run nginx --image=nginx # Generate spec for running pod nginx and write it into a file called pod.yaml
--dry-run=client -o yaml > pod.yaml --dry-run=client -o yaml > pod.yaml
kubectl attach my-pod -i # Attach to Running Container kubectl attach my-pod -i # Attach to Running Container