diff --git a/Clase 5/Ejercicio/node-show-text-app/deployment.yaml b/Clase 5/Ejercicio/node-show-text-app/deployment.yaml index 8791d6d..571bc81 100644 --- a/Clase 5/Ejercicio/node-show-text-app/deployment.yaml +++ b/Clase 5/Ejercicio/node-show-text-app/deployment.yaml @@ -7,19 +7,21 @@ spec: replicas: 1 selector: matchLabels: + com.docker.project: node-app app: node-app template: metadata: labels: + com.docker.project: node-app app: node-app spec: containers: - name: node-app - image: ubuntu + image: node command: - "/bin/sh" - "-c" - - "tail -f /dev/null" + - "cd /app && npm install && node app.js" env: - name: PORT value: "3000" @@ -39,23 +41,7 @@ spec: cpu: "500m" ports: - containerPort: 3000 - lifecycle: - postStart: - exec: - command: - - "/bin/sh" - - "-c" - - "apt-get update" - - "&&" - - "apt-get install curl -y" - - "&&" - - "curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh" - - "&&" - - "bash nodesource_setup.sh" - - "&&" - - "apt install nodejs" - - "&&" - - "cd /app && npm install && node app.js" + protocol: TCP volumeMounts: - name: app-files mountPath: /app/app.js diff --git a/Clase 5/Ejercicio/node-show-text-app/service-load-balancer.yaml b/Clase 5/Ejercicio/node-show-text-app/service-load-balancer.yaml new file mode 100644 index 0000000..c302c3c --- /dev/null +++ b/Clase 5/Ejercicio/node-show-text-app/service-load-balancer.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: node-app-svc-lb + namespace: node-app +spec: + ports: + - name: 80-tcp + port: 80 + protocol: TCP + targetPort: 3000 + selector: + com.docker.project: node-app + type: LoadBalancer +status: + loadBalancer: {} \ No newline at end of file diff --git a/Clase 5/README.md b/Clase 5/README.md index 4003c40..f40575e 100644 --- a/Clase 5/README.md +++ b/Clase 5/README.md @@ -3,4 +3,7 @@ ![Diap2](./img/Diap2.png) ![Diap3](./img/Diap3.png) +Comando para entrar a la terminal de un contenedor: +`kubectl exec -n {namespace} --stdin --tty {pod-name} -- /bin/bash` + ![Diap4](../img/Agradecimiento.png)