|
1 | 1 | # hello, world
|
2 | 2 |
|
| 3 | +Whatever [Kubernetes Installation](install.md) you use, here is a first example how to use it, |
| 4 | +inspired by [Kubernetes' tutorial](https://kubernetes.io/docs/tutorials/stateless-application/expose-external-ip-address/) |
| 5 | +or [GKE's Quickstart](https://cloud.google.com/kubernetes-engine/docs/quickstart). |
| 6 | + |
3 | 7 | ## [echoserver](https://github.com/kubernetes/kubernetes/tree/master/test/images/echoserver)
|
4 | 8 |
|
5 |
| - k create deployment echoserver --image=k8s.gcr.io/echoserver:1.10 |
6 |
| - k expose deployment echoserver --type=LoadBalancer --port=8080 |
7 |
| - curl $(minikube service --url=true echoserver) |
| 9 | + $ k create deployment echoserver --image=k8s.gcr.io/echoserver:1.10 |
| 10 | + $ k expose deployment echoserver --type=LoadBalancer --port=8080 |
| 11 | + $ k get service echoserver |
| 12 | + NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE |
| 13 | + echoserver LoadBalancer 10.x.y.z a.b.c.d 8080:32151/TCP 1m |
| 14 | + |
| 15 | +The `echoserver` web page is now available at http://a.b.c.d:8080. |
| 16 | +If the external IP address is still shown as _"pending",_ then wait for a minute and retry. |
| 17 | +BTW when using [`minikube`](install.md#minikube) there may not be an `EXTERNAL-IP`, then you have to use `minikube service` instead: |
| 18 | + |
| 19 | + $ minikube service --url=true echoserver |
| 20 | + |
| 21 | +Execute the following commands to have a look at what Kubernetes created based on the commands above: |
| 22 | + |
| 23 | + $ k describe service echoserver |
| 24 | + $ k get -o yaml service echoserver |
| 25 | + $ k describe deployment echoserver |
| 26 | + $ k get -o yaml deployment echoserver |
| 27 | + $ k describe replicaset echoserver |
| 28 | + $ k get -o yaml replicaset |
| 29 | + $ k get -o yaml pod |
| 30 | + $ k describe pod echoserver |
| 31 | + (...) |
| 32 | + Limits: |
| 33 | + cpu: 500m |
| 34 | + ephemeral-storage: 1Gi |
| 35 | + memory: 2Gi |
| 36 | + |
| 37 | +Note how the CPU, Memory and Storage Limits were automatically chosen. In a next step, you'll want to set more appropriate limits yourself. |
| 38 | +To remove this first example from your cluster, clean up both the service and deployment, which will also remove its replicaset and pod: |
| 39 | + |
| 40 | + $ k delete service echoserver |
| 41 | + $ k delete deployment echoserver |
8 | 42 |
|
9 |
| -## Dashboard |
| 43 | +## Dashboard for Minikube |
10 | 44 |
|
11 | 45 | minikube dashboard
|
12 | 46 |
|
13 |
| -If you run `minikube` inside a Virtual Machine (VM) instead of on your Laptop/Desktop workstation, then you'll need to set up some port forwarding to be able to access services in your local web browser. |
| 47 | +If you run `minikube` inside a Virtual Machine (VM) instead of on your Laptop/Desktop workstation, |
| 48 | +then you'll need to set up some port forwarding to be able to access services in your local web browser. |
0 commit comments