mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Merge pull request #7942 from goltermann/master
Simple nginx Guide Fixes
This commit is contained in:
commit
97004c87c1
@ -6,12 +6,9 @@ to Kubernetes and running your first containers on the cluster.
|
||||
|
||||
### Running a container (simple version)
|
||||
|
||||
Assume that ```${KUBERNETES_HOME}``` points to the directory where you installed the kubernetes directory.
|
||||
From this point onwards, it is assumed that ```kubectl``` is on your path from one of the getting started guides.
|
||||
|
||||
Once you have your cluster created you can use ```${KUBERNETES_HOME/kubernetes/cluster/kubectl.sh``` to access
|
||||
the kubernetes api.
|
||||
|
||||
The `kubectl.sh` line below spins up two containers running
|
||||
The `kubectl` line below spins up two containers running
|
||||
[Nginx](http://nginx.org/en/) running on port 80:
|
||||
|
||||
```bash
|
||||
@ -19,12 +16,16 @@ kubectl run-container my-nginx --image=nginx --replicas=2 --port=80
|
||||
```
|
||||
|
||||
Once the pods are created, you can list them to see what is up and running:
|
||||
```base
|
||||
```bash
|
||||
kubectl get pods
|
||||
```
|
||||
|
||||
To stop the two replicated containers:
|
||||
You can also see the replication controller that was created:
|
||||
```bash
|
||||
kubectl get rc
|
||||
```
|
||||
|
||||
To stop the two replicated containers, stop the replication controller:
|
||||
```bash
|
||||
kubectl stop rc my-nginx
|
||||
```
|
||||
@ -34,11 +35,11 @@ On some platforms (for example Google Compute Engine) the kubectl command can in
|
||||
to do this run:
|
||||
|
||||
```bash
|
||||
kubectl expose rc nginx --port=80 --create-external-load-balancer
|
||||
kubectl expose rc my-nginx --port=80 --create-external-load-balancer
|
||||
```
|
||||
|
||||
This should print the service that has been created, and map an external IP address to the service.
|
||||
|
||||
### Next: Configuration files
|
||||
Most people will eventually want to use declarative configuration files for creating/modifying their applications. A [simplified introduction](simple-yaml.md)
|
||||
is given in a different document.
|
||||
is given in a different document.
|
||||
|
Loading…
Reference in New Issue
Block a user