Skip to content

Commit 2cc3d11

Browse files
Jaime Salas ZancadaJaime Salas Zancada
authored andcommitted
added monolith in memory exercise
1 parent b304721 commit 2cc3d11

5 files changed

Lines changed: 51 additions & 23 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Todo App React
2+
3+
## Run solution locally
4+
5+
First we need to install dependencies change directory to `todo-app/frontend` and run `npm install`, then change directory to `/todo-app` and run `npm install`. Once that all dependencies are installed, we can run the solution locally by changing directory to `todo-app/frontend` and running `npm run run-p -l start:server start:dev`.
6+
7+
## Environment Variables
8+
9+
```ini
10+
NODE_ENV=
11+
PORT=
12+
```
13+
14+
## Running the Application with Docker on Local
15+
16+
```bash
17+
$ docker build -t jaimesalas/lc-todo-monolith .
18+
```
19+
20+
Start app without database
21+
22+
```bash
23+
$ docker run -d -p 3000:3000 \
24+
-e NODE_ENV=production \
25+
-e PORT=3000 \
26+
jaimesalas/lc-todo-monolith
27+
```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Monolito en memoria
2+
3+
## Enunciado
4+
5+
Construir los distintos recursos de Kubernetes para generar un clúster, como el de la siguiente imagen:
6+
7+
![monolith in memory](./monolith-in-mem.png)
8+
9+
### Para ello seguir los siguientes pasos:
10+
11+
### Paso 1. Crear todo-app
12+
13+
Crear un `Deployment` para `todo-app`, usar el `Dockerfile` de este direetorio **todo-app**, para generar la imagen necesaria.
14+
15+
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
16+
17+
* **NODE_ENV** : El entorno en que se está ejecutando el contenedor, nos vale cualquier valor que no sea `test`
18+
* **PORT** : El puerto por el que va a escuchar el contenedor.
19+
20+
### Paso 2. Acceder a todo-app desde fuera del clúster
21+
22+
Crear un `LoadBalancer service` para acceder al `Deployment` anteriormente creado desde fuera del clúster. Para poder utilizar un `LoadBalancer` con minikube seguir las instrucciones de este [artículo](https://minikube.sigs.k8s.io/docs/handbook/accessing/)
23+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<mxfile modified="2020-12-06T19:04:03.748Z" 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="7qDEBO5y6vxC52D70SB4" version="13.10.9" type="device"><diagram id="WI9T0HZ2pTsCkuznbFz-" name="Page-1">3Vlbb6M4FP41eSwyBgI8pmnTXXUqVVOtdmfeHHDALWBknIbsr99jMAmXXJqoSWc2rRT8+fh2znc+G2dkTdPyQZA8fuIhTUYYheXIuhthbKIxgi+FrGvEcZwaiAQLtdEWeGH/0qalRpcspEXHUHKeSJZ3wYBnGQ1kByNC8FXXbMGT7qg5iegAeAlIMkT/ZqGMNWqO/W3FH5RFsR7aw25dkZLGWK+kiEnIVy3Iuh9ZU8G5rJ/SckoT5bzGL3W72Z7azcQEzeRHGkyCMnwij48o/ct5+8necZKJG9PTk5PrZsU0BAfoIhcy5hHPSHK/RW8FX2YhVd0iKG1tvnGeA2gC+EqlXOtokqXkAMUyTXQtzFis/4HCDTKQbTfID9WjYY3dBrgr9Rh1ad0uPVPBUiqp0GAhBX+jU55wUa3D8pD6g5qhoxoiERFRecA7mqrKI62G2r0PlMP4Yg0GgiZEsvcuZYhmXrSx000nQpB1yyDnLJNFq+dnBYCBTiLsaQbpFLJxO87wUHf4scZmk5DN6AVfioDqVp1uW0vcQhWpTiHY+CsIdgYZvjrIaNyNk93L5tPsj7Biw4Je62OsGE7D3D2NTUd1jl2OXv5vQq+jWmP9EjQ0tbg08bS8k2jVa41t77pi4x5kA03mfHW5jQxSobOR2f45+1g1SXh+p0IyOIdciG7ji9BtwAirJ1OAXJURGP8m+lD74cBK/OsEzLEtw+mGzEENciVRx19zKC2ZVKlsQibbulwnsoMcXd4msiqsW4VBGjfKoHTA6woDMvGvcsKFlV6FVj72DN/2N5+uKnimYY/xtvq6uwb+kjNEQzf1wtOlG0L2+XQD9tpWl25j17sS3Y6K2LXoZiKMDccxXWyblutbZu9cgnxDVyDLtj08Pu/061sQPX8vqz3DMx20+XxMRE8+saHeFuv5h+fsowPm3QPeGRn2PSrX6+AtfShM+8frwnv8TsiNjt87SZY6ok884wmDnAAuZOq2hKZcMDJIRElLOeBixjOVgguWJD2olV8LnkmdfNhuyrpjVd+cryYJizLAUhaGVWYTDQTAbpUMmu7KnpYdPg4yYMjjpoHTe4XXxVXrSglpLG7dJvXfptrM78jgqRHBg4gMXN/yZUiKeKN1q5hJWuSkSvSVIHkvFKAU2HOde7xLQxbVB2o0rQF0buFfqR7kxxTUylJfIwesp1WFWcG4h/o70aqLvqW/p2O3ag31Ozoxe5g6knRs4R+WF5NceSEtI3X7abwt51RkoKGFwQKeqWWKP6uHO5p/Bo1w77Udj5ujWYtJ1g4iNbeSn04k6ziRGi+xtLprbSdpPwml2jw36Dcyp8kzL5hklQ/nXEqegkGiKm5J8BZV2/AuflWDTYq8vhNWvCVNYcFKReZbPZ+7WEp1mTxRjsCzIMxwFb0Fgw1eGAGMiGchkSBOM4WDFs8yHtLXQunazFTU2ABwzMmz6BNCjQehHkqGfU3FsAeBTjgJb+YkIVkAOrlHufe+Fe0X8YEA75XqSopeulLUPZh9QiRct/dC5O8Qb9PZkXOXCoUzCMUkz/+/Aeinwg7/78qEM9wPxe3vMfXhZ/urlnX/Hw==</diagram></mxfile>
9.97 KB
Loading

02-orquestacion/exercises/00-monolith-in-mem/todo-app/README.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)