From c902a9fee0ed4e870887019d6d4009f12350b2bc Mon Sep 17 00:00:00 2001 From: Alejandro Lembke Barrientos Date: Tue, 13 Sep 2022 15:32:50 -0600 Subject: [PATCH] agregando clase 4 --- .DS_Store | Bin 10244 -> 10244 bytes .gitignore | 3 +- Clase 1/.DS_Store | Bin 6148 -> 6148 bytes Clase 1/Ejercicio/.DS_Store | Bin 6148 -> 6148 bytes Clase 2/.DS_Store | Bin 6148 -> 6148 bytes Clase 2/Ejercicio/.DS_Store | Bin 6148 -> 6148 bytes Clase 4/.DS_Store | Bin 0 -> 6148 bytes .../node-show-text-app/configmap.yaml | 42 +++++++++++ .../node-show-text-app/deployment.yaml | 69 ++++++++++++++++++ .../node-show-text-app/namespace.yaml | 4 + .../Ejercicio/node-show-text-app/secret.yaml | 8 ++ .../Ejercicio/node-show-text-app/service.yaml | 14 ++++ 12 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 Clase 4/.DS_Store create mode 100644 Clase 4/Ejercicio/node-show-text-app/configmap.yaml create mode 100644 Clase 4/Ejercicio/node-show-text-app/deployment.yaml create mode 100644 Clase 4/Ejercicio/node-show-text-app/namespace.yaml create mode 100644 Clase 4/Ejercicio/node-show-text-app/secret.yaml create mode 100644 Clase 4/Ejercicio/node-show-text-app/service.yaml diff --git a/.DS_Store b/.DS_Store index f2af21634f8ffd599c8e2b6546c4f955e8cb6aea..6f081f6901caed54514ef9e0530a9c10647ccd8d 100644 GIT binary patch delta 212 zcmZn(XbG6$I9U^hRb(qtZigB<2&7CH*X7Dkf|rR^u1OY&`25;S9*TqRM4Av0M? z;vBl*y2%3Ke1ayPIr+&+Ir&Kp3=9Gc3{2^h^~GfwO(y$_w@>bpao}fXaAwG1NMtBx zNM%r9Fq!NosmNlIo9{AtqNEZ~S)ZgTvq?e5WDiMsMw89gB!d|_j4jM{6pW0FCwI$8 XPyQgFvbjL|3DahFg+O+6r|AIz*E%-n delta 121 zcmZn(XbG6$&nUeyU^hRb^kg1^gB)f?Mmh>6#wL@0O89P85;S9*d{DNA(PFZloc-ii zQhbw@CC+hJ8UocAn;8KGr6+$7Fq-TpxnT1QX%|Lh-S(4BWYjl%$?j#^*sz&#GrK|{ IJKQLJ0N_C-Z2$lO diff --git a/.gitignore b/.gitignore index cc5ffdb..a88d11a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ CuestionarioKubernetes.docx Videos de Clase Hojas de Asistencia Clase 3/Clase 3.pptx -Clase 3/Ejercicio/nginx-app \ No newline at end of file +Clase 3/Ejercicio/nginx-app +Clase 4/Clase 4.pptx \ No newline at end of file diff --git a/Clase 1/.DS_Store b/Clase 1/.DS_Store index ef7dd8074e9bcf919578c5a1f2d389847b6123b9..352fcff81ef8a654b6c61d03243d8a026efde61d 100644 GIT binary patch delta 495 zcmZoMXfc=|#>B!ku~2NHo+2an#(>?7ixrre7`Z3&Fj*V&F}N^fGNdx3GvotV`3$*0 zULKHF3KXmI%*jtq%E?b+U|Bn1{L;LXVzAy|hy({G2WPy1WVKthp}Cobj)Jj;QLTB)qu~2NHo+2aL#(>?7jBJy6Sga>+V-=n}jm2p4V%FZxG92726B{0H hX6NAN0IJ?B$nl+dGQWr;2Lli=GBB`gju2VH3;;-96P*A6 diff --git a/Clase 1/Ejercicio/.DS_Store b/Clase 1/Ejercicio/.DS_Store index 29d41772485bcafd5b35280a4f410915061413f0..6a28dc57d2dcadcd1d4a8ee9ac734d7d1ac57ebe 100644 GIT binary patch delta 146 zcmZoMXffDez$C!Hz~BhPdjG+Ifnl-(lNv~HJ({4@xqpRo1r-iqFo;&CBlw8UX~1j1ZcE7fQpZ9-v)PoAa1w Luxw`M_{$Fff3YPh delta 97 zcmZoMXffDez$EY=4NP`mQo|-FHF*LPH{*`UbC?RbC911U&5U&vOpGljOEOC{c1<>A VmS^k+YL(iY&pd-=GaJW0egJ%NF{}Up diff --git a/Clase 2/.DS_Store b/Clase 2/.DS_Store index c1db7d3b3c5ef448514f334f609cc63d3a131570..c62c45762778a2e01b3fe7a8444d2a3fc9bce016 100644 GIT binary patch delta 70 zcmZoMXffC@orQ7dJrt}re?-E3MR&uwK@vb7UrfPwpnd0Cx@uAzI9N1c1~_y Xe%E9}R(Zzm&4H}jm^QO<{No1z*31;C diff --git a/Clase 2/Ejercicio/.DS_Store b/Clase 2/Ejercicio/.DS_Store index 9570fcfd5d6fab76f77aeb6061b29f3c8cdfda6f..5426c6664e29cf033248a4fec580035489aa7b2b 100644 GIT binary patch delta 182 zcmZoMXfc=|#>CJ*u~2NHo}w@l0|Nsi1A_nqLyl)oesWSye$vE3&B+ELEUByvxeS#I z#SDcADWGDYN(M(D*82|zKo&?0u988Qp@1O+h(RKW3@Jc5lOYdgG*~SI!+IbM)xX)1 n`54RQ0A^pN&Fmcf96*NwMZPmn<`*$!WSDHjBfU9BWCb$-*(Whs literal 6148 zcmeHKK~BR!47A%K1#yYQh2wsqKL}NN;M@~8Xj-6B!bZ^E^A_I1cX$Jg*H+akAVoq# zfNaU0jk8{7XQMbKBA)G5Q=*)RGN|C_6y_6=`=UJ=ndbz^X^k~)>6QXL)227u9lwzQ zIlFVJaB5G~(&70%;vBcM88hsTYKm8Ntd@0LB0^r5Yv|p35{w3~Qr}M(RczW6qh?_K zCYGh;&+_@p+q!za9G8*nkh60cXG&_+t#9W{YHJif)|&XTTZQGa%oG z02M3@JH_P%YdHMD<`ssWqJ|S&^TC#x ztwZ6I9qWfQow!hR>kK#p#|(`1GMD;4|GNJ_4)QB!z!~^g4Dh5}lrwC}YHM$EQfmYB q1}Y-+I>mhm2B{Qdu9V^nXcG8?41k4Urw9+ke*_W@Zk&N1W#9ut*-g~| diff --git a/Clase 4/.DS_Store b/Clase 4/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..ea07b926b1afe592a60db4900c3819098a3fef3b GIT binary patch literal 6148 zcmeHKyH3ME5S)b+K~SWmyf27^_<ygdy3mT05aR&odFX7W4a<Dp-xDiK+)%_;=XkMnNOjDZ3Zw#k1rEJC(fYrje{=uuld_izqym3R0U6D& z=QI9N)YiezX{{~v8~Ud)*U}k!hX8i86rb+o6>T%G26m1{=eW^{c@R)t(o%unP~Zcb C;3ygZ literal 0 HcmV?d00001 diff --git a/Clase 4/Ejercicio/node-show-text-app/configmap.yaml b/Clase 4/Ejercicio/node-show-text-app/configmap.yaml new file mode 100644 index 0000000..e3ea512 --- /dev/null +++ b/Clase 4/Ejercicio/node-show-text-app/configmap.yaml @@ -0,0 +1,42 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: node-app-configmap + namespace: node-app +data: + # Mensaje personalizado + message: "Este es un mensaje personalizado." + # file-like keys + # Archivo de app (Código) + app.js: | + const express = require('express') + const app = express() + const port = process.env.PORT ? process.env.PORT : 80 + + app.get('/', (req, res) => { + res.send(process.env.MESSAGE ? process.env.MESSAGE : 'Hello World!') + }) + + app.get('/secret', (req, res) => { + res.send(process.env.SECRET ? process.env.SECRET : 'Hello Secret World!') + }) + + + app.listen(port, () => { + console.log(`Example app listening on port ${port}`) + }) + package.json: | + { + "name": "show-text-app", + "version": "1.0.0", + "description": "example app", + "main": "app.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "Alejandro Lembke Barrientos", + "license": "MIT", + "dependencies": { + "express": "^4.18.1" + } + } \ No newline at end of file diff --git a/Clase 4/Ejercicio/node-show-text-app/deployment.yaml b/Clase 4/Ejercicio/node-show-text-app/deployment.yaml new file mode 100644 index 0000000..8791d6d --- /dev/null +++ b/Clase 4/Ejercicio/node-show-text-app/deployment.yaml @@ -0,0 +1,69 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: node-app + namespace: node-app +spec: + replicas: 1 + selector: + matchLabels: + app: node-app + template: + metadata: + labels: + app: node-app + spec: + containers: + - name: node-app + image: ubuntu + command: + - "/bin/sh" + - "-c" + - "tail -f /dev/null" + env: + - name: PORT + value: "3000" + - name: SECRET + valueFrom: + secretKeyRef: + name: node-app-secret + key: secret + - name: MESSAGE + valueFrom: + configMapKeyRef: + name: node-app-configmap + key: message + resources: + limits: + memory: "128Mi" + 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" + volumeMounts: + - name: app-files + mountPath: /app/app.js + subPath: app.js + - name: app-files + mountPath: /app/package.json + subPath: package.json + volumes: + - name: app-files + configMap: + name: node-app-configmap \ No newline at end of file diff --git a/Clase 4/Ejercicio/node-show-text-app/namespace.yaml b/Clase 4/Ejercicio/node-show-text-app/namespace.yaml new file mode 100644 index 0000000..4875e50 --- /dev/null +++ b/Clase 4/Ejercicio/node-show-text-app/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: node-app \ No newline at end of file diff --git a/Clase 4/Ejercicio/node-show-text-app/secret.yaml b/Clase 4/Ejercicio/node-show-text-app/secret.yaml new file mode 100644 index 0000000..c16ae59 --- /dev/null +++ b/Clase 4/Ejercicio/node-show-text-app/secret.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Secret +metadata: + name: node-app-secret + namespace: node-app +type: Opaque +data: + secret: RXN0ZSBlcyB1biB0ZXh0byBzZWNyZXRvLg== diff --git a/Clase 4/Ejercicio/node-show-text-app/service.yaml b/Clase 4/Ejercicio/node-show-text-app/service.yaml new file mode 100644 index 0000000..7a69df2 --- /dev/null +++ b/Clase 4/Ejercicio/node-show-text-app/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: node-app-svc + namespace: node-app + labels: + app: node-app +spec: + type: ClusterIP + selector: + app: node-app + ports: + - port: 80 + targetPort: 3000 \ No newline at end of file