Configuration for running Kubernetes/CoreOS/Rudder on Digital Ocean
This guide is far from perfect, and can be probably be improved/automated quite a bit. Please send pull requests for corrections, clarifications and omissions.
You're going to need a Digital Ocean account. If you don't have one, click here and use my referral link to get you (and me!) some free credit on Digital Ocean. I host all the Gopher Academy and GopherCon sites on Digital Ocean, so your referral credits will be put to good use.
Follow this guide to install a three node CoreOS Cluster on Digital Ocean. I named my servers "master", "minion1" and "minion2" instead of the recommended "coreos-1", "coreos-2", and "coreos-3" so that I would remember which machines had which responsibilities.
Go to the Digital Ocean control panel and write down the public and private IP addresses of all three machines.
Yours might look like this:
Machine Name | Public IP | Private IP |
---|---|---|
master | 104.131.x.1 | 10.132.x.1 |
minion1 | 104.131.x.2 | 10.132.x.1 |
minion2 | 104.131.x.3 | 10.132.x.1 |
Install Flannel so that each pod in the Kubernetes cluster can have it's own IP address.
On one of the CoreOS machines, checkout the Rudder source and follow the instructions to use their docker container to build Rudder.
When you're done you should have Rudder installed at /opt/bin/rudder
Configure Rudder on each machine.
In /etc/systemd/system on each CoreOS machine, create a service file for rudder. Use this one as a template. Replace the line IP address my template with the correct PRIVATE IP address for that machine. Remember you can get that by typing ifconfig
. My private IP addresses were on eth1
.
Repeat this process for all three machines, ensuring that you use each machine's private ip address in the rudder.service file.
Add the service to systemctl:
sudo systemctl enable /etc/systemd/system/rudder.service
Reload systemctl:
sudo systemctl daemon-reload
Start Rudder:
sudo systemctl start rudder
Follow this same pattern to add docker
, kubelet
, and proxy
services to all three machines. Remember to use YOUR private IP address in the kubelet.service file. Add each service, reload systemctl and start each service.
On the master, add apiserver
and controller-manager
. In the apiserver.service
file, list the private IP addresses of all three CoreOS machines on Line 15
*** Important - you need to add a scheduler service now, too. I'll try to add a service unit for this shortly. ***
Download kubecfg
pre-built binaries by following the instructions at the bottom of Kelsey Hightower's Guide I put mine in /opt/bin
With any luck you'll now have a fully operational Kubernetes cluster running on Digital Ocean. To test it type kubecfg list minions
. You should see all three private ip addresses of your cluster listed in the result.
I couldn't have gotten the cluster running without lots of debugging help from Kelsey Hightower. I also drew a lot of inspriation from this post