Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Devops con Docker y Kubernetes y más

Devops con Docker y Kubernetes y más

La brecha entre desarrollo y operaciones puede ser más fácil de superar con las herramientas adecuadas. En esta charla hablaremos de qué es DevOps y veremos cómo utilizando Docker y Kubernetes podemos simplificar nuestro flujo de trabajo y el paso a producción para ir adoptando las buenas prácticas que la filosofía Devops propone.

A75784e761e7bb40e1e652b7a8cc31b5?s=128

Laura Morillo-Velarde

November 22, 2019
Tweet

More Decks by Laura Morillo-Velarde

Other Decks in Programming

Transcript

  1. @Laura_Morillo @Laura_Morillo DevOps with Docker and Kubernetes and more!

  2. @Laura_Morillo @Laura_Morillo • Twitter: @laura_morillo • GDG Madrid Organizer, WTM

    Lead • Startup lover. • Tech Lead at Seedtag. • Google Developer Expert (Cloud) • +12 years working with different technologies.
  3. @Laura_Morillo @Laura_Morillo • Twitter: @laura_morillo • GDG Madrid Organizer, WTM

    Lead • Startup lover. • Tech Lead at Seedtag. • Google Developer Expert (Cloud) • +12 years working with different technologies.
  4. @Laura_Morillo 1. What’s DevOps?

  5. @Laura_Morillo

  6. @Laura_Morillo https://youtu.be/LdOe18KhtT4

  7. @Laura_Morillo Developers Developers point of view Operators

  8. @Laura_Morillo Developers Operators point of view Operators

  9. @Laura_Morillo Developers Business point of view Operators

  10. @Laura_Morillo Collaboration

  11. @Laura_Morillo

  12. @Laura_Morillo C A L M S

  13. @Laura_Morillo C ulture A L M S

  14. @Laura_Morillo C ulture A utomation L M S

  15. @Laura_Morillo C ulture A utomation L ean M S

  16. @Laura_Morillo C ulture A utomation L ean M easurement S

  17. @Laura_Morillo C ulture A utomation L ean M easurement S

    haring
  18. @Laura_Morillo 2. Tools

  19. @Laura_Morillo 2.1 Docker

  20. @Laura_Morillo Malcom McLean 1956

  21. @Laura_Morillo

  22. @Laura_Morillo Node.js v11

  23. @Laura_Morillo Node.js v11 Yarn

  24. @Laura_Morillo Node.js v11 SSH Keys Yarn

  25. @Laura_Morillo Dockerfile FROM node:11-alpine WORKDIR /code RUN mkdir -p /home/node/.ssh

    RUN mkdir -p /code/src && chown -R node /code ADD ssh-keys/* /home/node/.ssh/ RUN echo "IdentityFile /home/node/.ssh/id_rsa" >> /home/node/.ssh/config RUN ssh-keyscan github.com >> /home/node/.ssh/known_hosts RUN chown -R node /home/node && chmod -R u+w /home/node && chmod 600 /home/node/.ssh/* USER node ADD package.json yarn.lock /code RUN yarn ADD . . CMD ["yarn", "start"]
  26. @Laura_Morillo Node Container for Development Container for Production Dockerfile Docker

    Repository (images)
  27. @Laura_Morillo

  28. @Laura_Morillo 2.2 Kubernetes

  29. “ Kubernetes does the things that the very best system

    administrator would do: automation, failover, centralized logging, monitoring. It takes what we’ve learned in the DevOps community and makes it the default, out of the box. Kelsey Hightower
  30. kubernetes: pod Node Volumes Redis

  31. @Laura_Morillo apiVersion: extensions/v1beta1 kind: Deployment metadata: name: my-service spec: replicas:

    3 template: metadata: labels: run: my-service spec: containers: - name: seedtag-my-service image: eu.gcr.io/project-id/my-service:latest deployment.yaml
  32. @Laura_Morillo Cluster Instance 1 v1 Instance 3 v1 Instance 2

    v1 Node 1 Node 2
  33. @Laura_Morillo apiVersion: v1 kind: Service metadata: name: my-service spec: selector:

    app: MyApp ports: - protocol: TCP port: 80 targetPort: 3000 Service.yaml
  34. @Laura_Morillo Cluster Instance 1 v1 App2 v1 Instance 3 v1

    Instance 2 v1 Node 1 Node 2
  35. @Laura_Morillo apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: test-ingress spec: backend:

    serviceName: my-service servicePort: 80 Ingress.yaml
  36. @Laura_Morillo Cluster Instance 1 v1 App2 v1 Instance 3 v1

    Instance 2 v1 Node 1 Node 2
  37. @Laura_Morillo apiVersion: extensions/v1beta1 spec: template: spec: containers: - name: seedtag-geolocation-service

    image: eu.gcr.io/project-id/geolocation-service:latest ... resources: requests: cpu: "1" memory: "400Mi" limits: cpu: "1.5" memory: "1Gi" deployment.yaml resources
  38. @Laura_Morillo apiVersion: extensions/v1beta1 spec: template: spec: containers: - name: seedtag-geolocation-service

    image: eu.gcr.io/project-id/geolocation-service:latest ... readinessProbe: httpGet: path: /status port: 3000 initialDelaySeconds: 5 periodSeconds: 10 timeoutSeconds: 5 deployment.yaml Readiness probe
  39. @Laura_Morillo apiVersion: extensions/v1beta1 spec: template: spec: containers: - name: seedtag-geolocation-service

    image: eu.gcr.io/project-id/geolocation-service:latest ... livenessProbe: httpGet: path: /status port: 3000 initialDelaySeconds: 30 periodSeconds: 15 timeoutSeconds: 5 deployment.yaml liveness probe
  40. @Laura_Morillo scaler.yaml apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler Metadata: name: seedtag-geolocation-service namespace:

    default Spec: scaleTargetRef: apiVersion: extensions/v1beta1 kind: Deployment name: seedtag-geolocation-service minReplicas: 2 maxReplicas: 10 targetCPUUtilizationPercentage: 70
  41. @Laura_Morillo Cluster Instance 2 v1 Instance 1 v1 Instance 3

    v1 Node 1 Node 2
  42. @Laura_Morillo Cluster Instance 1 v1 Instance 4 v1 Instance 3

    v1 Instance 2 v1 Node 1 Node 2 Instance 5 v1 ????
  43. @Laura_Morillo Cluster Instance 1 v1 Instance 4 v1 Instance 3

    v1 Instance 2 v1 Node 1 Node 2 Instance 5 v1 Node 3
  44. @Laura_Morillo 2.3 Prometheus

  45. @Laura_Morillo

  46. @Laura_Morillo

  47. @Laura_Morillo

  48. @Laura_Morillo

  49. @Laura_Morillo 2.4 Grafana

  50. @Laura_Morillo

  51. @Laura_Morillo

  52. @Laura_Morillo

  53. @Laura_Morillo

  54. @Laura_Morillo 2.4 Testing

  55. @Laura_Morillo

  56. @Laura_Morillo 2.5 Jenkins

  57. @Laura_Morillo

  58. @Laura_Morillo

  59. @Laura_Morillo 2.6 Ansible

  60. @Laura_Morillo 3. NoOps

  61. @Laura_Morillo https://go.forrester.com/blogs/11-02-07-i_dont_want_devops_i_want_noops/

  62. “ DevOps is not a goal, but a never-ending process

    of continual improvement. Jez Humble
  63. None
  64. @Laura_Morillo thanks! Any questions? We are hiring! @laura_morillo laura.morillovelarde@gmail.com Presentation

    template by SlidesCarnival