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

Migrating to containers

Migrating to containers

Talk at OpenR&Day — OODrive

Matthieu Moquet

June 22, 2016
Tweet

More Decks by Matthieu Moquet

Other Decks in Programming

Transcript

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

    of what to run Foreground process Require root
  2. !" aci-manifest.yml !" attributes # $" redis.yml !" runlevels #

    $" build # $" install.sh # $" prestart-early # $" init.sh $" templates $" etc $" redis $" redis.conf.tmpl
  3. !" 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
  4. !" 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
  5. !" 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
  6. !" 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 …
  7. !" 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 }} ...
  8. !" 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
  9. 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