mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-06 11:42:14 +00:00
rename run-container to run in kubectl
This commit is contained in:
@@ -46,7 +46,7 @@ The `kubectl.sh` line below spins up two containers running
|
||||
[Nginx](http://nginx.org/en/) running on port 80:
|
||||
|
||||
```bash
|
||||
cluster/kubectl.sh run-container my-nginx --image=nginx --replicas=2 --port=80
|
||||
cluster/kubectl.sh run my-nginx --image=nginx --replicas=2 --port=80
|
||||
```
|
||||
|
||||
To stop the containers:
|
||||
|
@@ -18,7 +18,7 @@ If the status of any node is ```Unknown``` or ```NotReady``` your cluster is bro
|
||||
|
||||
### Run an application
|
||||
```sh
|
||||
kubectl -s http://localhost:8080 run-container nginx --image=nginx --port=80
|
||||
kubectl -s http://localhost:8080 run nginx --image=nginx --port=80
|
||||
```
|
||||
|
||||
now run ```docker ps``` you should see nginx running. You may need to wait a few minutes for the image to get pulled.
|
||||
@@ -31,7 +31,7 @@ kubectl expose rc nginx --port=80
|
||||
This should print:
|
||||
```
|
||||
NAME LABELS SELECTOR IP PORT(S)
|
||||
nginx <none> run-container=nginx <ip-addr> 80/TCP
|
||||
nginx <none> run=nginx <ip-addr> 80/TCP
|
||||
```
|
||||
|
||||
Hit the webserver:
|
||||
|
@@ -51,7 +51,7 @@ If you are running different kubernetes clusters, you may need to specify ```-s
|
||||
|
||||
### Run an application
|
||||
```sh
|
||||
kubectl -s http://localhost:8080 run-container nginx --image=nginx --port=80
|
||||
kubectl -s http://localhost:8080 run nginx --image=nginx --port=80
|
||||
```
|
||||
|
||||
now run ```docker ps``` you should see nginx running. You may need to wait a few minutes for the image to get pulled.
|
||||
@@ -64,7 +64,7 @@ kubectl expose rc nginx --port=80
|
||||
This should print:
|
||||
```
|
||||
NAME LABELS SELECTOR IP PORT(S)
|
||||
nginx <none> run-container=nginx <ip-addr> 80/TCP
|
||||
nginx <none> run=nginx <ip-addr> 80/TCP
|
||||
```
|
||||
|
||||
Hit the webserver:
|
||||
|
@@ -47,7 +47,7 @@ You can now use any of the cluster/kubectl.sh commands to interact with your loc
|
||||
cluster/kubectl.sh get pods
|
||||
cluster/kubectl.sh get services
|
||||
cluster/kubectl.sh get replicationcontrollers
|
||||
cluster/kubectl.sh run-container my-nginx --image=nginx --replicas=2 --port=80
|
||||
cluster/kubectl.sh run my-nginx --image=nginx --replicas=2 --port=80
|
||||
|
||||
|
||||
## begin wait for provision to complete, you can monitor the docker pull by opening a new terminal
|
||||
|
@@ -164,7 +164,7 @@ NAME IMAGE(S SELECTOR REPLICAS
|
||||
Start a container running nginx with a replication controller and three replicas
|
||||
|
||||
```sh
|
||||
$ ./cluster/kubectl.sh run-container my-nginx --image=nginx --replicas=3 --port=80
|
||||
$ ./cluster/kubectl.sh run my-nginx --image=nginx --replicas=3 --port=80
|
||||
```
|
||||
|
||||
When listing the pods, you will see that three containers have been started and are in Waiting state:
|
||||
|
Reference in New Issue
Block a user