From af50366896a776d3d9ada88c35c6f4a857943fa9 Mon Sep 17 00:00:00 2001 From: iaoiui Date: Sat, 9 May 2020 11:27:52 +0900 Subject: [PATCH] Some docs incorrect v1.18 kubectl run command (#20784) * use "kubectl create deploy" instead of "kubectl run" * omit whitspace fix * omit whitspace fix * avoid shorthand --- content/en/docs/concepts/policy/resource-quotas.md | 3 ++- .../en/docs/tasks/administer-cluster/namespaces-walkthrough.md | 3 ++- content/en/docs/tasks/administer-cluster/namespaces.md | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/content/en/docs/concepts/policy/resource-quotas.md b/content/en/docs/concepts/policy/resource-quotas.md index 8ae3111323..39f51bf2d7 100644 --- a/content/en/docs/concepts/policy/resource-quotas.md +++ b/content/en/docs/concepts/policy/resource-quotas.md @@ -494,7 +494,8 @@ kubectl create quota test --hard=count/deployments.extensions=2,count/replicaset ``` ```shell -kubectl run nginx --image=nginx --replicas=2 --namespace=myspace +kubectl create deployment nginx --image=nginx --namespace=myspace +kubectl scale deployment nginx --replicas=2 --namespace=myspace ``` ```shell diff --git a/content/en/docs/tasks/administer-cluster/namespaces-walkthrough.md b/content/en/docs/tasks/administer-cluster/namespaces-walkthrough.md index 9a69058ceb..9e3f4d6371 100644 --- a/content/en/docs/tasks/administer-cluster/namespaces-walkthrough.md +++ b/content/en/docs/tasks/administer-cluster/namespaces-walkthrough.md @@ -268,7 +268,8 @@ kubectl get pods Production likes to run cattle, so let's create some cattle pods. ```shell -kubectl run cattle --image=k8s.gcr.io/serve_hostname --replicas=5 +kubectl create deployment cattle --image=k8s.gcr.io/serve_hostname +kubectl scale deployment cattle --replicas=5 kubectl get deployment ``` diff --git a/content/en/docs/tasks/administer-cluster/namespaces.md b/content/en/docs/tasks/administer-cluster/namespaces.md index de2230a6a4..076f81d9b9 100644 --- a/content/en/docs/tasks/administer-cluster/namespaces.md +++ b/content/en/docs/tasks/administer-cluster/namespaces.md @@ -189,7 +189,8 @@ This delete is asynchronous, so for a time you will see the namespace in the `Te To demonstrate this, let's spin up a simple Deployment and Pods in the `development` namespace. ```shell - kubectl run snowflake --image=k8s.gcr.io/serve_hostname --replicas=2 -n=development + kubectl create deployment snowflake --image=k8s.gcr.io/serve_hostname -n=development + kubectl scale deployment snowflake --replicas=2 -n=development ``` We have just created a deployment whose replica size is 2 that is running the pod called `snowflake` with a basic container that just serves the hostname. Note that `kubectl run` creates deployments only on Kubernetes cluster >= v1.2. If you are running older versions, it creates replication controllers instead.