From 622e5f97131586e36bd018b9b361e7a4dbb93f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wang=28=E3=82=8F=E3=82=93=29?= Date: Mon, 15 Jun 2020 21:06:55 +0900 Subject: [PATCH] update latest kubectl run syntax --dry-run is deprecated `--restart=Never` flag is unnecessary to create a pod from 1.18 --- content/en/docs/reference/kubectl/cheatsheet.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/en/docs/reference/kubectl/cheatsheet.md b/content/en/docs/reference/kubectl/cheatsheet.md index 23d074456c..36629d2c29 100644 --- a/content/en/docs/reference/kubectl/cheatsheet.md +++ b/content/en/docs/reference/kubectl/cheatsheet.md @@ -290,10 +290,10 @@ kubectl logs -f my-pod # stream pod logs (stdout) kubectl logs -f my-pod -c my-container # stream pod container logs (stdout, multi-container case) kubectl logs -f -l name=myLabel --all-containers # stream all pods logs with label name=myLabel (stdout) kubectl run -i --tty busybox --image=busybox -- sh # Run pod as interactive shell -kubectl run nginx --image=nginx --restart=Never -n +kubectl run nginx --image=nginx -n mynamespace # Run pod nginx in a specific namespace -kubectl run nginx --image=nginx --restart=Never # Run pod nginx and write its spec into a file called pod.yaml ---dry-run -o yaml > pod.yaml +kubectl run nginx --image=nginx # Run pod nginx and write its spec into a file called pod.yaml +--dry-run=client -o yaml > pod.yaml kubectl attach my-pod -i # Attach to Running Container kubectl port-forward my-pod 5000:6000 # Listen on port 5000 on the local machine and forward to port 6000 on my-pod