Richard Bucker

skydns from docker to rkt

Posted at — Jul 17, 2016

I’m trying to move my projects from docker to rkt for reasons described by the CoreOS team and my own personal feelings about docker. As a result I was able to get my skydns container to run nicely as a rkt container.

Pre-Requisites:

The process is pretty simple:
  • convert the docker container to a rkt container
    ./docker2aci docker://skynetservices/skydns
  • run the rkt version
    sudo rkt run –net=host  –insecure-options=image skynetservices-skydns-latest.aci –exec=“/skydns”
There is some room for improvement in the RUN. For example, daemon vs interactive; and whether the DNS server is to be bridged to the host or the container subnet. Then you have to make some choices about how the containers are going to talk and how skydns is going to connect to etcd, fleet, and possibly flannel.

There was some doc that suggested that I run skydns like this:

systemd-run –slice=machine rkt run –net=host  –insecure-options=image /home/rbucker/bin/skynetservices-skydns-latest.aci –exec=“/skydns”

Bus since I wanted to use fleet my service file looked like:


[Unit]
Description=skydns service
After=docker.service

[Service]
ExecStart=/usr/bin/rkt run –net=host  –insecure-options=image /home/rbucker/bin/skynetservices-skydns-latest.aci –exec=“/skydns”
RestartSec=30s
Restart=on-failure

[Install]
WantedBy=multi-user.target

[X-Fleet]
X-Conflicts=skydns.service

It’s probably not an ideal configuration but it seems to work.  The idea it RUN the container until is stops and then RESTART is. This assumes that the stop is a FAILURE.

Pushing DNS this hard is starting to make me wonder if I should not be using kubernetes after all. A recent solo-kube video makes me believe it might be the right way to go. In the meantime this is what I have.