Running container at BlaBlaCar — While 42 (San-Francisco)

Running container at BlaBlaCar — While 42 (San-Francisco)

Meetup While42 in San-Francisco

F135ce7f204af6fac8075b469685c91d?s=128

Matthieu Moquet

April 06, 2016
Tweet

Transcript

  1. Running containers at #While42 (San-Francisco)

  2. $100 $25 $25 $25 $25

  3. 25 million members in January 2016

  4. 22 countries

  5. 20M 40M 80M 160M 129M 2014 2015 2016 2017 Travelers

    transported 2014
  6. metal servers services run. containers 120 150+ 2000+

  7. None
  8. github.com/coreos/rkt

  9. $ (sudo) rkt run ./image.aci Archive of filesystem & instructions

    of what to run Foreground process Require root
  10. $ rkt run example.org/image.aci Fetch the image first and then

    run it
  11. How to build an ACI?

  12. App Container (appc) Open specification that defines several aspects of

    how to run applications in containers
  13. Pronounced « digg-er » github.com/blablacar/dgr

  14. ├── aci-manifest.yml ├── attributes │ └── redis.yml ├── runlevels │

    └── build │ └── install.sh └── templates └── etc └── redis └── redis.conf.tmpl
  15. name: aci-redis aci: app: exec: - /usr/bin/redis-server - /etc/redis/redis.conf

  16. name: aci-redis aci: app: exec: - /usr/bin/redis-server - /etc/redis/redis.conf dependencies:

    - aci-debian Not included in redis image
  17. Runlevel: Build

  18. ├── aci-manifest.yml ├── attributes │ └── redis.yml ├── runlevels │

    └── build │ └── install.sh └── templates └── etc └── redis └── redis.conf.tmpl
  19. #!/bin/bash apt install -y redis-server

  20. Runlevel: Prestart

  21. Dump configuration files Initialize database/user Enable/Disable modules Change mod/owner

  22. ├── aci-manifest.yml ├── attributes │ └── redis.yml ├── runlevels │

    └── build │ └── install.sh └── templates └── etc └── redis └── redis.conf.tmpl
  23. # templates/etc/redis/redis.conf.tmpl daemonize no port {{ .redis.port }} ... #

    attributes/redis.yml default: redis: port: 6379 Resolved at runtime
  24. POD Running several ACIs in the same context

  25. name: example.org/pod-myapp:1 pod: apps: - dependencies: - example.org/aci-nginx:1.8.1 app: exec:

    [/usr/sbin/nginx, -g, daemon off] - dependencies: - example.org/aci-php:5.6 - example.org/aci-myapp:42 app: exec: [/usr/sbin/php5-fpm, -F]
  26. $ rkt run \ example.org/pod-myapp_aci-nginx:1 \ example.org/pod-myapp_aci-php:1

  27. pod-myapp_aci-nginx pod-myapp_aci-php Linux kernel other process ... 1.2.3.4 172.16.8.8 :80

    :9000
  28. Services discovery with smartstack synapse + nerve by Airbnb

  29. Zookeeper haproxy php healtcheck mysql client server

  30. Thank you! @BlaBlaCarTech @MattKetmo blablatech.com