|
|
@ -8,7 +8,7 @@ These are two approaches to create the description in Kuberentes: |
|
|
|
# create a namespace |
|
|
|
kubectl create namespace web-test |
|
|
|
|
|
|
|
# Then choose one way: |
|
|
|
# Then choose one of the following ways: |
|
|
|
# (1) Create the description |
|
|
|
kubectl create -f nginx.yml -f service.yml |
|
|
|
|
|
|
@ -31,7 +31,7 @@ kubectl get -n web-test pods |
|
|
|
kubectl get -n web-test deployment |
|
|
|
|
|
|
|
# show services for our namespace |
|
|
|
kubectl show -n web-test service |
|
|
|
kubectl get -n web-test service |
|
|
|
|
|
|
|
# show logs of deployed nginx instances |
|
|
|
kubectl logs -n web-test deployment/nginx-deployment |
|
|
@ -67,6 +67,7 @@ The nginx instances are reachable at the floating ips of the **node**-instances |
|
|
|
|
|
|
|
### Nginx description |
|
|
|
|
|
|
|
*nginx.yml:* |
|
|
|
```yml |
|
|
|
apiVersion: apps/v1 |
|
|
|
kind: Deployment |
|
|
@ -93,6 +94,7 @@ spec: |
|
|
|
|
|
|
|
### Nginx service description |
|
|
|
|
|
|
|
*service.yml:* |
|
|
|
```yml |
|
|
|
apiVersion: v1 |
|
|
|
kind: Service |
|
|
@ -109,5 +111,5 @@ spec: |
|
|
|
targetPort: 80 |
|
|
|
# Optional field |
|
|
|
# By default and for convenience, the Kubernetes control plane will allocate a port from a range (default: 30000-32767) |
|
|
|
nodePort: 3000 |
|
|
|
nodePort: 30007 |
|
|
|
``` |