Skip to content

Commit b304721

Browse files
Jaime Salas ZancadaJaime Salas Zancada
authored andcommitted
added ingress exercise
1 parent 8eb0671 commit b304721

4 files changed

Lines changed: 38 additions & 1 deletion

File tree

02-orquestacion/exercises/02-distributed/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ Start frontend, in order to get connected fron and back, you must build the imag
2020

2121
```bash
2222
$ docker run -d -p 80:80 --name todo-front lemoncode/todo-front
23-
```
23+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<mxfile modified="2020-12-06T16:51:14.523Z" host="app.diagrams.net" agent="5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36" etag="WEpgk1yDe9MNm1aB9k_Y" version="13.10.9" type="device"><diagram id="WI9T0HZ2pTsCkuznbFz-" name="Page-1">5Vjbbts4EP0aP9qQKMuXR+fi7G4bNECQdrdvtERLdChSoGhb7tfvUKJkyfQtqJ0UbQIk5OHwNufMkFTHu03yB4nT+FGEhHWQE+Yd766DkOsMHPinkU2JDFxUApGkoTHaAs/0B6l6GnRJQ5K1DJUQTNG0DQaCcxKoFoalFOu22Vyw9qwpjogFPAeY2eg3GqrYoO5gvG34i9AoNlOP0LBsSHBlbHaSxTgU6wbk3Xe8WymEKktJfkuYdl7ll7Lf9EBrvTBJuDqnwyTIw0f86ZOTvPiv3+kKMS677sAsTm2qHZMQHGCqQqpYRIJjdr9Fb6RY8pDoYR2obW0+C5EC6AK4IEptDJt4qQRAsUqYac2UFK/kVjAhizm9kaN/oQX2Ijf/mpGLyn+60vOr6l3ebLzbmJrtjEosWEbEQI/uJPnxbS2X/2QMfR1/WS5eFl2vtNO7bnQ0LnwgIiEwDxhIwrCiq7YssFFXVNuZrhMp8aZhkArKVdYY+UkDYGACBflGJSZMKv1Pz7R3R37THgrlCvb3dg/MVi83E0sZENPr2DKcwfGBSvdbA0Gh4dwtVEj2LfIdHpUvYTOxvqhya312nZ4DwdMSaX98QqVF7YlICvsmsgL1IqG8IlJRSDxH4+Msne911eAqOrcU4e0qAnlnSetSiqim+xhFOMOdtIV+YUVUsXptSfjDnWyD/GtJYm+GNwteYbY0W7AkAmdzqos0Ka4DTX4rEiaMRhwwpXVRo5/xjLAnkVFFhW6dCaVEAgZMN9zg4DUqFNZgbl78gEkx2SRLy2uL5hJXlTnNtSZvzHruYqX0fWeifYOmQcjdHoUbz5yCdmUvgBnRNMQKwz+Nw0EzjUnehTKUXDTSOI8kybJeyiPjD9gCyVucWiqytVBf7HbOn7Gpr7eXpOqQiRvXI985rJ4W728lGf2GJPdPkswgWWXdmcQ8zLoQVVPUhz88ojzvAu0XIturArYKYM8mu7+H7P61yPZ+Q7LRSbI5PK4WmU5nJqQr4IJE70T14IOjun/0MH/318ne8/IsB7/z6wG1XgOn7f3jr41dXezYv/W1ceb5f/YyrvDa2KvGgZV2/i4PVQAFBN6KkrUlWIhGZYmKC66lOqeM7UANHc4FV0akkNZN3Qy8L48lNAyLCMAGCECV+lJ5c4nU0Hb9yE4MnnmC/uwR8JIR+WW20GkTOUXSrVL8FKfUrJvhgMSCQa5sf9/hODF+/4olxTPwR4Ef5XXY2LnRgU3gwQRxmEuLh4OMrWOqyHMKmwJ0LbE+kLSi5qx4CMRgR/hliKxzev3lwKZytCfHo7czCdUGmafIvQazoz+Z2Tr43oXZ81Lo2EqhLOgqEYoeCZeHcue7E9S+Qlw+eyLHt5gZXoyZ7Sfl8uDbfpj37v8H</diagram></mxfile>
16.6 KB
Loading
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Ingress
2+
3+
## Enunciado
4+
5+
Construir los distintos recursos de Kubernetes para generar un clúster, como el de la siguiente imagen:
6+
7+
![distributed](./distributed.png)
8+
9+
### Para ello seguir los siguientes pasos:
10+
11+
### Paso 1. Crear todo-front.
12+
13+
Crear un `Deployment` para `todo-front`, usar el `Dockerfile` de este directorio **02-distributed/todo-front**, para generar la imagen necesaria. Notar que existe `ARG API_HOST` dentro del fichero `Dockerfile`, lo podemos omitir en este caso, sólo está ahí para poder probar el contenedor de Docker en local.
14+
15+
Al ejecutar un contenedor a partir de la imagen anterior, el puerto expuesto para http es el 80.
16+
17+
Crear un `Cluster IP Service` que exponga `todo-front` dentro del clúster.
18+
19+
### Paso 2. Crear todo-api.
20+
21+
Crear un `Deployment` para `todo-api`, usar el `Dockerfile` de este directorio **02-distributed/todo-api**, para generar la imagen necesaria.
22+
23+
Al ejecutar un contenedor a partir de la imagen anaterior, el puerto por defecto es el 3000, pero se lo podemos alimentar a partir de variables de entorono, las variables de entorno serían las siguientes
24+
25+
* **NODE_ENV** : El entorno en que se está ejecutando el contenedor, nos vale cualquier valor que no sea `test`
26+
* **PORT** : El puerto por el que va a escuchar el contenedor
27+
28+
(_Opcional_) Crear un `ConfigMap` que exponga las variables de entorno anteriores.
29+
30+
Crear un `Cluster IP Service` que exponga `todo-api` dentro del clúster.
31+
32+
### Paso 3. Crear un Ingress para acceder a los servicios del clúster
33+
34+
Crear un `Ingress` para exponer los servicios anteriormente creados. Como referencia para crear este controlardor con `minikube` tomar como referencia el siguiente ejemplo [Set up Ingress on Minikube with the NGINX Ingress Controller](https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/)
35+
36+

0 commit comments

Comments
 (0)