Skip to main content

Struggling with rkt, flannel, etcd

I'll say it again, I want to make Docker go away from my stack for all the reasons that the CoreOS team talks about. Granted I cannot eliminate it all but I should be able to get rid of a lot. And here are my challenges:

etcd2

Make sure that etcd is listening on 0.0.0.0. I wish this were not the case because it means that rogue apps could communicate with etcd directly just by connecting to the network and while not a terrible thing it does require more network security instead of secure by default.

I had several problems with my cloud_config, aka user_data, and frankly I did not want to reinstall my IntelNuc as it is unpleasant to install.

I manually updated: /var/lib/coreos-install/user_data
I also edited my local cloud_config.yml
and I bootstrapped from my local cloud_config.yml with this:

sudo systemctl stop etcd2
sudo systemctl stop fleet
sleep 2
sudo rm -rf /var/lib/etcd2/proxy/cluster
sudo rm -rf /var/lib/etcd2/proxy
sudo coreos-cloudinit --from-file ./cloud-config.yml 

fleet

I'm twisted on this because one CoreOS webpage says that fleet is included and another says it's not. There are also countless docker examples and no fleet examples.

Building fleet with rkt on the CoreOS host was yet another hardship but I managed to fix it.

$ etcdctl set /coreos.com/network/config '{ "Network": "172.16.0.0/16" }'

and for the moment I'm running flannel in the foreground.

sudo ./artifacts/flanneld

I have read some docs that show how to configure fleet from the cloud_config file but it's limited information and does not actually start flanneld. It's merely configuration.

I found the missing link. Starting flannel from the systemctl looks likeL

sudo systemctl start flanneld

Looking at the flanneld.service file I was disappointed to see that flannel used docker and that it was really very complicated to launch:

/usr/lib64/systemd/system/flanneld.service

rkt

rkt lacks daemon mode and the ability to reattach to a daemon. These are mechanisms found in docker and were helpful when creating the unit files. rkt requires sidekicks.

One trick is getting the networks correct. It's going to be a particular challenge when I start clustering the machines.

SkyDNS

The rkt-skydns project does a good job of tracking the pod's IP address. The project was missing some basic support for SkyDNS but the developer made the corrections very quickly. Now I can start my brb, aka helloworld, with a simple command line and is easily converted to a fleet unit:

ExecStart=/usr/bin/rkt run --net=default --insecure-options=image \
        /home/rbucker/bin/brb-0.0.1-linux-amd64.aci \
        /home/rbucker/bin/rkt-sidekick-v0.0.2-linux-amd64.aci \
        -- --cidr 172.16.0.0/16 -f '{"host":"$ip", "port":3000}' /skydns/local/ncx/brb

One bug remains, multiple networks, which one is installed in DNS?

the bottom line

This is hard and the documentation make it harder still. The various teams may or may not make changes to the code or projects and that means toiling through this same exercise again and I do not look forward to it. I am likely at the point in time where I must learn everything I can about kubernetes and leave the details, like these, to someone else.

I'm really surprised that someone does not have a project that makes this a no brainer. Something very opinionated and simply works.

UPDATE: notice that I added some comments about launching flanneld... but since we are talking about the flannel subnet with no host ingress it feels like kubernetes is still the right answer as it has a mechanism for port forwarding.

Popular posts from this blog

Prometheus vs Bosun

In conclusion... while Bosun(B) is still not the ideal monitoring system neither is Prometheus(P).

TL;DR;

I am running Bosun in a Docker container hosted on CoreOS. Fleet service/unit files keep it running. However in once case I have experienced at least one severe crash as a result of a disk full condition. That it is implemented as part golang, java and python is an annoyance. The MIT license is about the only good thing.

I am trying to integrate Prometheus into my pipeline but losing steam fast. The Prometheus design seems to desire that you integrate your own cache inside your application and then allow the server to scrape the data, however, if the interval between scrapes is shorter than the longest transient session of your application then you need a gateway. A place to shuttle your data that will be a little more persistent.

(1) storing the data in my application might get me started more quickly
(2) getting the server to pull the data might be more secure
(3) using a push g…

Entry level cost for CoreOS+Tectonic

CoreOS and Tectonic start their pricing at 10 servers. Managed CoreOS starts at $1000 per month for those first 10 servers and Tectonic is $5000 for the same 10 servers. Annualized that is $85K or at least one employee depending on your market. As a single employee company I'd rather hire the employee. Specially since I only have 3 servers.

The pricing is biased toward the largest servers with the largest capacities; my dual core 32GB i5 IntelNuc can never be mistaken for a 96-CPU dual or quad core DELL

If CoreOS does not figure out a different barrier of entry they are going to follow the Borland path to obscurity.

Weave vs Flannel

While Weave and Flannel have some features in common weave includes DNS for service discovery and a wrapper process for capturing that info. In order to get some parity you'd need to add a DNS service like SkyDNS and then write your own script to weave the two together.
In Weave your fleet file might have some of this:
[Service] . . . ExecStartPre=/opt/bin/weave run --net=host --name bob ncx/bob ExecStart=/usr/bin/docker attach bob
In sky + flannel it might look like:
[Service] . . . ExecStartPre=docker run -d --net=host --name bob ncx/bob ExecStartPre=etcdctl set /skydns/local/ncx/bob '{"host":"`docker inspect --format '{{ .NetworkSettings.IPAddress }}' bob`","port":8080}' ExecStart=/usr/bin/docker attach bob
I'd like it to look like this:
[Service] . . . ExecStartPre=skyrun --net=host --name bob ncx/bob ExecStart=/usr/bin/docker attach bob
That's the intent anyway. I'm not sure the exact commands will work and that's partly why we…