Skip to content

Commit e990e46

Browse files
author
Weiping Cai
committed
deprecated kubectl run command flag replicas for en
Signed-off-by: Weiping Cai <[email protected]>
1 parent 347d383 commit e990e46

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

content/en/docs/reference/kubectl/docker-cli-to-kubectl.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ You can use the Kubernetes command line tool kubectl to interact with the API Se
1313
{{% capture body %}}
1414
## docker run
1515

16-
To run an nginx Deployment and expose the Deployment, see [kubectl run](/docs/reference/generated/kubectl/kubectl-commands/#run).
16+
To run an nginx Pod and expose the Pod, see [kubectl run](/docs/reference/generated/kubectl/kubectl-commands/#run).
1717

1818
docker:
1919

@@ -39,22 +39,22 @@ kubectl:
3939
kubectl run --image=nginx nginx-app --port=80 --env="DOMAIN=cluster"
4040
```
4141
```
42-
deployment "nginx-app" created
42+
pod/nginx-app created
4343
```
4444

4545
{{< note >}}
46-
`kubectl` commands print the type and name of the resource created or mutated, which can then be used in subsequent commands. You can expose a new Service after a Deployment is created.
46+
`kubectl` commands print the type and name of the resource created or mutated, which can then be used in subsequent commands. You can expose a new Service after a Pod is created.
4747
{{< /note >}}
4848

4949
```shell
5050
# expose a port through with a service
51-
kubectl expose deployment nginx-app --port=80 --name=nginx-http
51+
kubectl expose pod nginx-app --port=80 --name=nginx-http
5252
```
5353
```
5454
service "nginx-http" exposed
5555
```
5656

57-
By using kubectl, you can create a [Deployment](/docs/concepts/workloads/controllers/deployment/) to ensure that N pods are running nginx, where N is the number of replicas stated in the spec and defaults to 1. You can also create a [service](/docs/concepts/services-networking/service/) with a selector that matches the pod labels. For more information, see [Use a Service to Access an Application in a Cluster](/docs/tasks/access-application-cluster/service-access-application-cluster).
57+
By using kubectl, you can create a [Pod](/docs/concepts/workloads/pods/pod/) to ensure that pod are running nginx. You can also create a [service](/docs/concepts/services-networking/service/) with a selector that matches the pod labels. For more information, see [Use a Service to Access an Application in a Cluster](/docs/tasks/access-application-cluster/service-access-application-cluster).
5858

5959
By default images run in the background, similar to `docker run -d ...`. To run things in the foreground, use:
6060

@@ -65,8 +65,8 @@ kubectl run [-i] [--tty] --attach <name> --image=<image>
6565
Unlike `docker run ...`, if you specify `--attach`, then you attach `stdin`, `stdout` and `stderr`. You cannot control which streams are attached (`docker -a ...`).
6666
To detach from the container, you can type the escape sequence Ctrl+P followed by Ctrl+Q.
6767

68-
Because the kubectl run command starts a Deployment for the container, the Deployment restarts if you terminate the attached process by using Ctrl+C, unlike `docker run -it`.
69-
To destroy the Deployment and its pods you need to run `kubectl delete deployment <name>`.
68+
Because the kubectl run command starts a Pod for the container, the Pod restarts if you terminate the attached process by using Ctrl+C, unlike `docker run -it`.
69+
To destroy the pod you need to run `kubectl delete pod <name>`.
7070

7171
## docker ps
7272

content/en/docs/tasks/administer-cluster/namespaces.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -226,25 +226,21 @@ This delete is asynchronous, so for a time you will see the namespace in the `Te
226226
Production likes to run cattle, so let's create some cattle pods.
227227

228228
```shell
229-
kubectl run cattle --image=k8s.gcr.io/serve_hostname --replicas=5 -n=production
229+
kubectl run cattle --image=k8s.gcr.io/serve_hostname -n=production
230230
231-
kubectl get deployment -n=production
231+
kubectl get pods -n=production
232232
```
233233
```
234-
NAME READY UP-TO-DATE AVAILABLE AGE
235-
cattle 5/5 5 5 10s
234+
NAME READY STATUS RESTARTS AGE
235+
cattle 1/1 Running 0 3s
236236
```
237237

238238
```shell
239239
kubectl get pods -l run=cattle -n=production
240240
```
241241
```
242242
NAME READY STATUS RESTARTS AGE
243-
cattle-2263376956-41xy6 1/1 Running 0 34s
244-
cattle-2263376956-kw466 1/1 Running 0 34s
245-
cattle-2263376956-n4v97 1/1 Running 0 34s
246-
cattle-2263376956-p5p3i 1/1 Running 0 34s
247-
cattle-2263376956-sxpth 1/1 Running 0 34s
243+
cattle 1/1 Running 0 34s
248244
```
249245

250246
At this point, it should be clear that the resources users create in one namespace are hidden from the other namespace.

0 commit comments

Comments
 (0)