Migrating to containers

Migrating to containers

Talk at OpenR&Day — OODrive

F135ce7f204af6fac8075b469685c91d?s=128

Matthieu Moquet

June 22, 2016
Tweet

Transcript

  1. MIGRATING TO CONTAINERS How BlaBlaCar moved to a full container

    architecture
  2. @MattKetmo

  3. None
  4. Servers convergence via Chef

  5. DATA CENTER INDUSTRIALIZATION

  6. CONTAINERS

  7. What’s a container?

  8. Process

  9. Process { } namespace Filesystem (chroot) Network

  10. metal servers services run. containers 120 200+ 3000+

  11. None
  12. github.com/coreos/rkt

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

    of what to run Foreground process Require root
  14. How to build an ACI?

  15. App Container Open specification defining how to run containers

  16. Pronounced « digg-er » github.com/blablacar/dgr

  17. !" aci-manifest.yml !" attributes # $" redis.yml !" runlevels #

    $" build # $" install.sh # $" prestart-early # $" init.sh $" templates $" etc $" redis $" redis.conf.tmpl
  18. !" aci-manifest.yml !" attributes # $" redis.yml !" runlevels #

    $" build # $" install.sh # $" prestart-early # $" init.sh $" templates $" etc $" redis $" redis.conf.tmpl name: aci-redis aci: app: exec: - /usr/bin/redis-server - /etc/redis/redis.conf
  19. !" aci-manifest.yml !" attributes # $" redis.yml !" runlevels #

    $" build # $" install.sh # $" prestart-early # $" init.sh $" templates $" etc $" redis $" redis.conf.tmpl name: aci-redis aci: app: exec: - /usr/bin/redis-server - /etc/redis/redis.conf dependencies: - aci-debian Not included in redis image
  20. !" aci-manifest.yml !" attributes # $" redis.yml !" runlevels #

    $" build # $" install.sh # $" prestart-early # $" init.sh $" templates $" etc $" redis $" redis.conf.tmpl #!/bin/bash apt install -y \ redis-server
  21. !" aci-manifest.yml !" attributes # $" redis.yml !" runlevels #

    $" build # $" install.sh # $" prestart-early # $" init.sh $" templates $" etc $" redis $" redis.conf.tmpl Initialize database/user Enable/Disable modules Change mod/owner Dump configuration files …
  22. !" aci-manifest.yml !" attributes # $" redis.yml !" runlevels #

    $" build # $" install.sh # $" prestart-early # $" init.sh $" templates $" etc $" redis $" redis.conf.tmpl daemonize no port {{ .redis.port }} timeout {{ .redis.timeout }} loglevel {{ .redis.loglevel }} databases {{ .redis.databases }} {{ if .redis.maxmemory }} maxmemory {{ .redis.maxmemory }} {{ endif }} ...
  23. !" aci-manifest.yml !" attributes # $" redis.yml !" runlevels #

    $" build # $" install.sh # $" prestart-early # $" init.sh $" templates $" etc $" redis $" redis.conf.tmpl default: redis: port: 6379 timeout: 0 loglevel: notice databases: 1 Attributes are resolved at runtime
  24. POD Running several ACIs in the same context

  25. nginx php-fpm Linux kernel other process ... 1.2.3.4 172.16.8.8 :80

    :9000 mysql 172.16.8.9 :3306
  26. Services discovery with smartstack synapse + nerve by Airbnb

  27. Zookeeper haproxy php healtcheck rabbitmq client server get /services/rabbitmq add

    /services/rabbitmq ip:port
  28. systemd [Unit] Description={{.hostname}} [Service] KillMode=mixed Restart=always ExecStart=/opt/bin/rkt run \ --hostname={{.hostname}}

    \ --set-env=TEMPLATER_OVERRIDE='{{.attributes}}' \ --volume=data,kind=host,source=/data/{{.hostname}} \ {{.acis}} ▾ fleet ▾ ggn
  29. PRIVATE CLOUD BUILD, DEPLOY & RUN RESILIENT TO FAILURES

  30. THANK YOU