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 • Twitter: @laura_morillo • GDG Madrid Organizer, WTM

    Lead • Startup lover. • Tech Lead at Seedtag. • Google Developer Expert (Cloud) • +12 years working with different technologies.
  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 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"]
  4. “ 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
  5. @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
  6. @Laura_Morillo apiVersion: v1 kind: Service metadata: name: my-service spec: selector:

    app: MyApp ports: - protocol: TCP port: 80 targetPort: 3000 Service.yaml
  7. @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
  8. @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
  9. @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
  10. @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
  11. @Laura_Morillo Cluster Instance 1 v1 Instance 4 v1 Instance 3

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

    v1 Instance 2 v1 Node 1 Node 2 Instance 5 v1 Node 3
  13. “ DevOps is not a goal, but a never-ending process

    of continual improvement. Jez Humble