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:CoreOS - kinda optionalrktdocker2aci - I forked this project so that [a] it could run statically in the CoreOS host and [b] so that I did not have to trust another binaryThe process is pretty simple:convert the docker container to a rkt container./docker2aci docker://skynetservices/skydnsrun the rkt versionsudo 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 serviceAfter=docker.service[Service]ExecStart=/usr/bin/rkt run –net=host  –insecure-options=image /home/rbucker/bin/skynetservices-skydns-latest.aci –exec="/skydns"RestartSec=30sRestart=on-failure[Install][X-Fleet]X-Conflicts=skydns.serviceIt’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.