Merge pull request #21707 from Cweiping/remove_kubectl_run_command_deprecated_en_from_dev_1.19
use kubectl create deployment to create deployment with --replicas and --port
This commit is contained in:
@@ -268,8 +268,7 @@ kubectl get pods
|
||||
Production likes to run cattle, so let's create some cattle pods.
|
||||
|
||||
```shell
|
||||
kubectl create deployment cattle --image=k8s.gcr.io/serve_hostname
|
||||
kubectl scale deployment cattle --replicas=5
|
||||
kubectl create deployment cattle --image=k8s.gcr.io/serve_hostname --replicas=5
|
||||
|
||||
kubectl get deployment
|
||||
```
|
||||
|
||||
@@ -189,12 +189,9 @@ 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 create deployment snowflake --image=k8s.gcr.io/serve_hostname -n=development
|
||||
kubectl scale deployment snowflake --replicas=2 -n=development
|
||||
kubectl create deployment snowflake --image=k8s.gcr.io/serve_hostname -n=development --replicas=2
|
||||
```
|
||||
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.
|
||||
If you want to obtain the old behavior, use `--generator=run/v1` to create replication controllers. See [`kubectl run`](/docs/reference/generated/kubectl/kubectl-commands/#run) for more details.
|
||||
|
||||
```shell
|
||||
kubectl get deployment -n=development
|
||||
|
||||
Reference in New Issue
Block a user