This is my first attempt at trying multi-cloud deployment with CoreOS. Not so famous cloud providers such as IDCF Cloud, it is very important to have cloud interoperabilities. With help of CoreOS and fleet, it would be possible to try out CoreOS on IDCF Cloud and deploy to any other clouds in production. What is more important is that without CloudFormation or OpenStack Heat, it would be possible to describe a template of muptiple instances also.
docker-registry through ngrok
I am usually running a private docker-registry with IDCF Object Storage backend and I want to avoid opening public connection to my repositories. The good news is that through a ngrok tunnel I can allow remote connections from the internet if necessary.
I have A docker-registry container running with -e flags for IDCF Object Storage credentials.
$ docker run -d -p 5000:5000 \ |
And then I run ngrok container pointing to that docker-registry.
$ docker run -it --rm --name ngrok \ |
Through ngrok provided URL it exposes private repositories to the internet.
Dedicated etcd instance opened to a CoreOS cluster
In reference to Setup a Dedicated etcd Cluster post, I decided to create a dedicated etcd instance.
I launched new IDCF Cloud instance from CoreOS ISO. After the instance started I opened console window in the browser, and changed core
user password for enabling ssh login with password.
Then I could do ssh login to my new CoreOS instance with -o flag.
$ ssh -A core@10.1.0.246 -o PreferredAuthentications=password |
210.129.xxx.xxx
is a public ip address which is assigned to my account. And do not forget to add new allow port rules and port forwading rules to the firewall.
The point is that I create allow rules to port 22, 4001 and 7001 from a few soruces below.
- Oddly enough, 10.1.0.0/22 is necessary for connecting to his public ip address (in this case 210.129.xxx.xxx) from inside IDCF Cloud instances.
- Peer DigitalOcan droplet public ip address
I prepared cloud-config.yml file for dedicated etcd instance. It is disabled running etcd.service and docker.service using mask: true
.
#cloud-config |
I installed CoreOS to the local disk with cloud-config.yml file specified with the -c flag.
$ sudo coreos-install -d /dev/sda -V 444.5.0 -C stable -c ./cloud-config.yml |
fleetctl testing
Before testing Core cluster successfully created, export two environment variables pointing to dedicated etcd instance. I could get a list of the cluster members.
$ export FLEETCTL_ENDPOINT=http://210.129.xxx.xxx:4001 |
Additionally, I verified that all the member machines accessible via SSH.
$ fleetctl ssh 2b27d51f |
Run a MoinMoin Service on a CoreOS
Following the instructions of DigitalOcean tutorial, I edited a template unit file.
[Unit] |
And I submitted fleet unite template to my cluster.
$ fleetctl submit moin@.service |
Then I could load and start MoinMoin service with the port number.
$ fleetctl load moin@80.service |
failover testing
Next thing should I do is to stop running CoreOS node without hesitation.
$ fleetctl ssh moin@80.service |
The 10.1.1.191 node previously running moin@80.service was disappeared in the list. In place of stopped node on IDCF Cloud, a new container on DigitalOcean activated being a failover node.
$ fleetctl list-machines |