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

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. Pablo Fredrikson @pablokbs • Professional Nerd • 12 años con

    Linux / Open Source • Lead SRE @ Invision
  2. 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"]
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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