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.

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!

    View full-size slide

  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.

    View full-size slide

  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.

    View full-size slide

  4. @Laura_Morillo
    1.
    What’s DevOps?

    View full-size slide

  5. @Laura_Morillo

    View full-size slide

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

    View full-size slide

  7. @Laura_Morillo
    Developers
    Developers point of view
    Operators

    View full-size slide

  8. @Laura_Morillo
    Developers
    Operators point of view
    Operators

    View full-size slide

  9. @Laura_Morillo
    Developers
    Business point of view
    Operators

    View full-size slide

  10. @Laura_Morillo
    Collaboration

    View full-size slide

  11. @Laura_Morillo

    View full-size slide

  12. @Laura_Morillo
    C
    A
    L
    M
    S

    View full-size slide

  13. @Laura_Morillo
    C ulture
    A
    L
    M
    S

    View full-size slide

  14. @Laura_Morillo
    C ulture
    A utomation
    L
    M
    S

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  18. @Laura_Morillo
    2.
    Tools

    View full-size slide

  19. @Laura_Morillo
    2.1
    Docker

    View full-size slide

  20. @Laura_Morillo
    Malcom
    McLean
    1956

    View full-size slide

  21. @Laura_Morillo

    View full-size slide

  22. @Laura_Morillo
    Node.js v11

    View full-size slide

  23. @Laura_Morillo
    Node.js v11
    Yarn

    View full-size slide

  24. @Laura_Morillo
    Node.js v11
    SSH Keys
    Yarn

    View full-size slide

  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"]

    View full-size slide

  26. @Laura_Morillo
    Node
    Container for
    Development
    Container for Production
    Dockerfile
    Docker Repository
    (images)

    View full-size slide

  27. @Laura_Morillo

    View full-size slide

  28. @Laura_Morillo
    2.2
    Kubernetes

    View full-size slide


  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

    View full-size slide

  30. kubernetes: pod
    Node
    Volumes
    Redis

    View full-size slide

  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

    View full-size slide

  32. @Laura_Morillo
    Cluster
    Instance 1 v1
    Instance 3 v1
    Instance 2 v1
    Node 1 Node 2

    View full-size slide

  33. @Laura_Morillo
    apiVersion: v1
    kind: Service
    metadata:
    name: my-service
    spec:
    selector:
    app: MyApp
    ports:
    - protocol: TCP
    port: 80
    targetPort: 3000
    Service.yaml

    View full-size slide

  34. @Laura_Morillo
    Cluster
    Instance 1 v1
    App2 v1
    Instance 3 v1
    Instance 2 v1
    Node 1 Node 2

    View full-size slide

  35. @Laura_Morillo
    apiVersion: networking.k8s.io/v1beta1
    kind: Ingress
    metadata:
    name: test-ingress
    spec:
    backend:
    serviceName: my-service
    servicePort: 80
    Ingress.yaml

    View full-size slide

  36. @Laura_Morillo
    Cluster
    Instance 1 v1
    App2 v1
    Instance 3 v1
    Instance 2 v1
    Node 1 Node 2

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  41. @Laura_Morillo
    Cluster
    Instance 2 v1
    Instance 1 v1
    Instance 3 v1
    Node 1 Node 2

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  44. @Laura_Morillo
    2.3
    Prometheus

    View full-size slide

  45. @Laura_Morillo

    View full-size slide

  46. @Laura_Morillo

    View full-size slide

  47. @Laura_Morillo

    View full-size slide

  48. @Laura_Morillo

    View full-size slide

  49. @Laura_Morillo
    2.4
    Grafana

    View full-size slide

  50. @Laura_Morillo

    View full-size slide

  51. @Laura_Morillo

    View full-size slide

  52. @Laura_Morillo

    View full-size slide

  53. @Laura_Morillo

    View full-size slide

  54. @Laura_Morillo
    2.4
    Testing

    View full-size slide

  55. @Laura_Morillo

    View full-size slide

  56. @Laura_Morillo
    2.5
    Jenkins

    View full-size slide

  57. @Laura_Morillo

    View full-size slide

  58. @Laura_Morillo

    View full-size slide

  59. @Laura_Morillo
    2.6
    Ansible

    View full-size slide

  60. @Laura_Morillo
    3.
    NoOps

    View full-size slide

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

    View full-size slide


  62. DevOps is not a goal, but a never-ending
    process of continual improvement.
    Jez Humble

    View full-size slide

  63. @Laura_Morillo
    thanks!
    Any questions?
    We are hiring!
    @laura_morillo
    [email protected]
    Presentation template by SlidesCarnival

    View full-size slide