$30 off During Our Annual Pro Sale. View Details »

La cloud de Google: Kubernetes

La cloud de Google: Kubernetes

Charla introductoria sobre Kubernetes que di en una Docker Meetup en Mendoza, Argentina

Pablo Fredrikson

November 23, 2017
Tweet

More Decks by Pablo Fredrikson

Other Decks in Technology

Transcript

  1. La cloud de Google: Kubernetes Pablo Fredrikson - Lead SRE

    @ Invision @pablokbs
  2. Pablo Fredrikson @pablokbs • Professional Nerd • 12 años con

    Linux / Open Source • Lead SRE @ Invision
  3. docker: básico FROM alpine:3.6 ENV PYTHON_VERSION 3.6.3 RUN set -ex

    \ && apk add --no-cache --virtual .fetch-deps \ gnupg \ libressl \ tar \ xz \ \ && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-$PYTHON_VERSION.tar.xz" ... CMD ["python3"]
  4. docker: básico $ docker run -it pablokbs/python3 hello-world.py Hello world

    :)
  5. docker: complejo - nginx-proxy $ docker run -d -p 80:80

    -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy $ docker run -e VIRTUAL_HOST=foo.bar.com pablokbs/myweb
  6. docker: complejo - nginx-proxy interwebz nginx-proxy my_app VIRTUAL_HOST= foo.example.com my_other_app

    VIRTUAL_HOST= bar.example.com foo.example.com docker.d
  7. docker: complejo - nginx-proxy $ docker run -d -P 80:80

    \ -v /var/run/docker.sock:/tmp/docker.sock:ro \ -v /root/docker/ssl/pablokbs.com/:/etc/nginx/certs/ \ jwilder/nginx-proxy $ docker run -d -p 80:80 \ -e VIRTUAL_HOST=www.pablokbs.com,pablokbs.com \ -e DEBUG=false \ -e ENVIRONMENT=production \ -v /root/docker/web/mycode/:/var/www/pablokbs_code/ \ pablokbs/myweb
  8. Solución! docker-compose $ cat docker-compose.yml nginx: image: jwilder/nginx-proxy ports: -

    "80:80" - "443:443" volumes: - /var/run/docker.sock:/tmp/docker.sock:ro - /root/docker/ssl/pablokbs.com/:/etc/nginx/certs/ myweb: image: pablokbs/myweb expose: - "80" environment: - VIRTUAL_HOST=www.pablokbs.com,pablokbs.com - DEBUG=false - ENVIRONMENT=production
  9. Solución! docker-compose $ docker-compose up -d Creating docker_nginx_1 … done

    docker_web_1 is up-to-date $ docker-compose ps Name Command State Ports ------------------------------------------------------------------------------------------------------- docker_nginx_1 /app/docker-entrypoint.sh Up 0.0.0.0:80 -> 80/tcp docker_web_1 /myapp.sh Up 80 ->80/tcp
  10. Solución! docker-compose + +

  11. Mascotas vs. Ganado Rambo Alberta, Lucrecia, Susana (?)

  12. Borg / Kubernetes https://landing.google.com/sre/book.html

  13. Kubernetes en 5 minutos Servicios de cluster de Kubernetes API

    worker K worker K worker K deployment pod1: - container1 - container2 replicas: 3 pod2: - container3 replicas: 2 p1r1 p2r1 p1r2 p1r3 p2r2
  14. Kubernetes en 5 minutos Servicios de cluster de Kubernetes API

    worker K worker K worker K deployment pod1: - container1 - container2 replicas: 3 pod2: - container3 replicas: 2 p1r1 p2r1 p1r2 p1r3 p2r2 p1r2
  15. Demo

  16. ¿Preguntas? @pablokbs @InvisionApp