Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

WeCodeFest: kubernetes and google container engine codelab

295 views

Published on

Soy desarrolladora de Software y siempre voy un paso por detrás en la parte de sistemas. Pero cuando trabajas en un equipo pequeño en una startup necesitas aprender un poco más de todo. En esta charla veremos las diferentes herramientas que Kubernetes nos provee para ayudarnos a crear una infraestructura escalable.

Para la realización del taller, los asistentes necesitarán registrarse en Google Cloud con una tarjeta de crédito. Para los nuevos usuarios, tendrán disponible hasta 300 euros de crédito al registrarse, los usuarios que ya tuvieran cuenta necesitarán correr con el coste de ejecución de los recursos utilizados en el taller que será inferior a 2 dólares.

Requisitos para el taller
Durante el taller necesitaremos contar con un entorno de kubernetes. La opción más sencilla es utilizar un entorno de Kubernetes alojado en la nube. Por simplicidad el servicio elegido será Google Cloud, por lo que los asistentes necesitarán registrarse previamente. Para ello deberías crearte una cuenta (https://accounts.google.com/SignUp) si no tienes ya una. Accede la consola (https://console.cloud.google.com) de Google Cloud Platform y crea un nuevo proyecto.

A continuación deberás activar la facturación en esta url https://console.cloud.google.com/billing.

Los nuevos usuarios pueden solicitar una prueba gratis de 300$ aquí (https://console.developers.google.com/billing/freetrial?hl=en), el coste de este taller no será de más de un par de dólares.

Published in: Software
  • Be the first to comment

WeCodeFest: kubernetes and google container engine codelab

  1. 1. Scalable infrastructure with kubernetes Simplifying a developer’s life @Laura_Morillo
  2. 2. ● Twitter: @laura_morillo ● GDG Madrid Organizer, WTM Lead ● Startup lover. ● Backend developer at Seedtag. ● 10 years working with different technologies. @Laura_Morillo
  3. 3. Getting ready! 1. Create a Google Account: https://accounts.google.com/SignUp 2. Register in Google Cloud Platform: http://console.cloud.google.com/ 3. Request free credit: https://console.developers.google.com/billing/freetrial?hl=en 4. Create a new project https://goo.gl/1sqOrk @Laura_Morillo
  4. 4. @Laura_Morillo
  5. 5. Node.js @Laura_Morillo
  6. 6. Node.js @Laura_Morillo
  7. 7. Docker OOP Simile Image Container Class Instance @Laura_Morillo
  8. 8. Dockerfile @Laura_Morillo
  9. 9. Dockerfile @Laura_Morillo
  10. 10. Dockerfile Docker Repository (images) @Laura_Morillo
  11. 11. Node.js Container for Staging Container for Production Dockerfile Docker Repository (images) (containers) @Laura_Morillo
  12. 12. Node.js Redis Loadbalancer Node.js Loadbalancer Node.js Redis Redis @Laura_Morillo
  13. 13. Pokemon Go traffic @Laura_Morillo
  14. 14. @Laura_Morillo
  15. 15. Kubernetes: cluster Cluster Node 1 (VM or physical machine) Node 2 (VM or physical machine) Node 3 (VM or physical machine) @Laura_Morillo
  16. 16. Creating our cluster! ● While creating the cluster a zone is required. Execute this first: ○ gcloud config set compute/zone europe-west1-d https://goo.gl/1sqOrk @Laura_Morillo
  17. 17. Pods Node.js Redis @Laura_Morillo Volumes ● Smallest unit ● Contains one or more containers ● Ephemeral entities ● One IP per pod ● Volumes for persistence ● You shouldn’t create them directly
  18. 18. Deployments ● Drive current state toward desired state V1 V1 @Laura_Morillo
  19. 19. Deployments @Laura_Morillo
  20. 20. Deployments Cluster Node 1 Node 2 Node 3 @Laura_Morillo
  21. 21. Deployments Redis V1 My Image V1 Redis V1 My Image V1 Cluster Node 1 Node 2 Node 3 @Laura_Morillo
  22. 22. Deployments Redis V1 My Image V1 Redis V1 My Image V1 Cluster Node 1 Node 2 Node 3 @Laura_Morillo
  23. 23. Services ● Defines a logical set of pods and a policy to access them Redis V1 My Image V1 Redis V1 My Image V1 Nginx V1 Service @Laura_Morillo
  24. 24. Services: ClusterIP @Laura_Morillo
  25. 25. Services: ClusterIP Redis V1 My Image V1 Redis V1 My Image V1 Cluster Node 1 Node 2 Nginx V1 my-node-app-service nginx-service @Laura_Morillo
  26. 26. Services: ClusterIP Redis V1 My Image V1 Redis V1 My Image V1 Cluster Node 1 Node 2 Nginx V1 Error! my-node-app-service nginx-service @Laura_Morillo
  27. 27. @Laura_Morillo Services: NodePort
  28. 28. Services: NodePort Redis V1 My Image V1 Redis V1 My Image V1 Cluster Node 1 Node 2 Nginx V1 NodePort Port: 31128 nginx-service NodePort Port: 31128 Node1_IP:31128 Node2_IP:31128 @Laura_Morillo
  29. 29. Services: LoadBalancer Public IP: Ej: 123.45.678.9 @Laura_Morillo
  30. 30. Services: LoadBalancer Redis V1 My Image V1 Redis V1 My Image V1 Cluster Node 1 Node 2 Nginx V1 IP: 123.45.678.9 my-node-app-service nginx-service @Laura_Morillo
  31. 31. Changes???? @Laura_Morillo
  32. 32. Deployments ● Controls new versions ● Rollback to previous versions ● We set the pod information, amount of pods, update strategy... V1 V2 Deployment @Laura_Morillo
  33. 33. Deployments: RollingUpdate @Laura_Morillo
  34. 34. Deployments: RollingUpdate Redis V1 My Image V1 Redis V1 My Image V1 @Laura_Morillo
  35. 35. Deployments: RollingUpdate @Laura_Morillo
  36. 36. Deployment: RollingUpdate Redis V1 My Image V1 Redis V1 My Image V1 @Laura_Morillo
  37. 37. Deployment: RollingUpdate Redis V1 My Image V1 Redis V1 My Image V1 Redis V1 My Image V2 @Laura_Morillo
  38. 38. Deployment: RollingUpdate Redis V1 My Image V1 Redis V1 My Image V1 Redis V1 My Image V2 @Laura_Morillo
  39. 39. Deployment: RollingUpdate Redis V1 My Image V1 Redis V1 My Image V1 Redis V1 My Image V2 Redis V1 My Image V2 @Laura_Morillo
  40. 40. Deployment: RollingUpdate Redis V1 My Image V1 Redis V1 My Image V1 Redis V1 My Image V2 Redis V1 My Image V2 @Laura_Morillo
  41. 41. Pokemon Go traffic @Laura_Morillo
  42. 42. HorizontalPodAutoscaler ● Scales the number of pods from a deployment ● At the moment, only based on the CPU utilizationRedis V1 My Image V2 HorizontalPodAutoescaler: From 2 to 10 Redis V1 My Image V2 Min 2 Redis V1 My Image V2 Max 10 1 2 10 @Laura_Morillo
  43. 43. HorizontalPodAutoscaler @Laura_Morillo
  44. 44. Summary ● Kubernetes is a cluster manager that helps us to: ○ Deploy our applications from Docker containers ○ Structure our application with microservices ○ Connect the different microservices ○ Provide external access to our services ○ Scale our infrastructure when we need it ○ And more! @Laura_Morillo
  45. 45. Extra notes ● For steps 9 and 10 curl should be executed from your console, not from Google Console. ● Step 12 commands should be: ○ cat deployments/auth.yaml ○ kubectl create -f deployments/auth.yaml ● Delete: Google Cloud Menu => Networking => Load Balancing https://goo.gl/1sqOrk @Laura_Morillo
  46. 46. @laura_morillo laura.morillovelarde@gmail.com We are hiring at seedtag! @Laura_Morillo

×