use replicas to replace kubectl scale deployment.

Signed-off-by: Weiping Cai <weiping.cai@daocloud.io>
This commit is contained in:
Weiping Cai 2020-06-14 11:25:07 +08:00
parent cf3becadff
commit 0202db7c00
No known key found for this signature in database
GPG Key ID: 97CBE6D7C8EBC386
2 changed files with 1 additions and 4 deletions

View File

@ -41,7 +41,7 @@ kubectl create deployment --image=nginx nginx-app --port=80
deployment.apps/nginx-app created
```
```
```shell
# add env to nginx-app
kubectl set env deployment/nginx-app DOMAIN=cluster
```

View File

@ -190,11 +190,8 @@ This delete is asynchronous, so for a time you will see the namespace in the `Te
```shell
kubectl create deployment snowflake --image=k8s.gcr.io/serve_hostname -n=development --replicas=2
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.
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