Deploying Applications to Exoscale using Registered Servers

Today we are going to show you how to deploy to Exoscale using Registered Servers feature.

We take you by the hand to deploy a Docker, Rails or Node project under 5 minutes including load balancing, Let's Encrypt SSL and all the cool feature we support.

As you might know, we integrate with all the major cloud providers and we love it. A lot of our customers, due to legislation or other legal issues, need to deploy their applications on servers which are running physically in their own country and also owned and operated by local companies.

Unfortunately, not all supported public cloud providers can comply with those rules. We provide a feature called Registered Servers to make this happen.

What? Registered Servers?

Registered Servers are essentially a pool of your own servers on a private or public cloud that can be used for any stack and configuration. Stacks can be deployed across a hybrid of cloud and registered servers, in this way you could have a dedicated server for your database and burst cloud servers for your front end.

Exoscale?

Exoscale is a Switzerland-based cloud provider which provides easy provisioning of VPS and support a lot of cool features like real-time provisioning, easy price model, intuitive UI and of course hosted in the best Swiss-based datacenter.

Great. Let's see how to get this thing going using Exoscale.

Let do this!

Prerequisite

  • Cloud 66 account - signup here for a two-week free trial account.
  • Exoscale account - signup here and get $5 of Exoscale free credits; Limited offer.

We are going to deploy a Docker Project with one load balancer, a two server docker cluster and a separated DB server. We need to provision 4 servers for this example.

NOTE: The following steps can also be used to deploy a Rails or Node project.

Sign in with Exoscale and setup the security group.

Security groups

Exoscale only works with at least 1 security group enabled. Security Groups provide a modular way to define and compose firewall rules. The rules are managed at the hypervisor level in order to restrict incoming and outgoing network traffic.

We make sure we open the ports we need to manage our stack. Although we are opening the ports to the world wide web with the security groups, after bringing the servers to Cloud 66, those ports are managed by Cloud 66 and port like 22 and the inter docker container networking is secured (= no access from the internet).

Sign in with Exoscale.

Go to https://portal.exoscale.ch/compute/firewalling and click on the default security group.

Make sure your security group looks like this:

alt

Provision the servers

It's time to provision some servers with Exoscale. A good thing is that you can provision servers on both datacenters (DK2 or GVA2) and Cloud 66 will make sure the intra-container communication, using a feature called ContainerNet, between servers/across datacenter is handled securely.

ContainerNet is a private and secure network (based on Weave) between all containers across all the servers and components in your stack, including databases. This network provides an internal IP address to each container, automatically updating with DHCP and DNS and is fully integrated with the life-cycle management of your services.

Provision the loadbalancer

Create a new Instances for the load balancer. Loadbalancers don't require much power, memory and storage. Choose a name (cloud66loadbalancer for example) and make sure your choose Ubuntu 16.04(LTS) image.

alt

Choice the Micro option (1 CPU / 512MB memory / 10GB disk). Don't use a Keypair. Cloud 66 will generate a new one as soon as you bring the server over.

alt

When Cloud 66 is deploying to your servers, a firewall will be installed and also SSH access only works with public/private key access and is closed by default to the outside world.

Hit CREATE to create the server.

alt

Provision the Docker nodes

Create the other three servers too. Choose a server which much more muscle to run your Docker services. 2 cores and 4GB memory is just fine to start. Of course, it all depends on your workload.

alt

If your services need persistency, choice a larger disk size.

Provision the Database node

After creating the Docker nodes. Create a server for our database. We want blazing fast disk performance, we choice a 200GB SSD.

alt alt

Bring them to Cloud 66

Great! In a couple of minutes, we are ready to build, deploy and manage your application on those servers. Let's bring them over.

Now it's time to log into your Cloud 66 account. Before we create any project, make sure we put our Exoscale servers into our inventory. Go to the Register Server panel and you find a command to run on each server to bring them on board.

alt

SSH to each server and login with your username root and password. You can find the root password on the dashboard, when you hit the root password it will be automagically copied to you clipboard.

~$ ssh root@xxx.xxx.xxx.xxx

alt

Register the server

Run the Cloud 66 register server command (of course change the xxx to the value you found in your register server panel)
root@cloud66dockernode2:~# curl -s https://app.cloud66.com/server/xxx/register_script.sh | bash -s

When the command is executed, you see the following message.

alt

Approve the servers

Your servers will show up automagically in the Cloud 66 UI. Approve them to add them to the server inventory.

alt

You can also tag the server to make them easy findable if you deploy a stack.

alt

Create a Docker project

Let's create a Docker stack. We are using a private docker image but also we let Cloud 66 build a docker image using the Build Grid feature. The onboarding UI will let you know if everything is good to go.

alt

We create a new deployment for a production environment.

alt

We start with a deployment of 1 Docker host and 1 Database host. And select the right servers we want our application to be deployed to.

alt

And we add another server for our MongoDB, MySQl database and RabbitMQ message queue.

alt

Of course one of our Docker services need access to the internet. Cloud 66 gives you an UI to set the port mapping and take care of all the load balancing and firewall management.

alt

Hit deploy stack and Cloud 66 will provision (= install all the packages, networking, db and security) the servers and start building and deploying your application. You get an e-mail when Cloud 66 is done setting up your application.

alt

Scale up!

Cloud 66 makes it really easy to scale up. Let's add an extra host to our Docker cluster and install a load balancer.

Go to the Docker cluster and hit the button Add Docker Server. Choose the right registered server and hit Add. Cloud 66 will provision this server and add this one to the Docker cluster and make sure all the intra-service networking is setup and secure.

Last but not least, we need a load balancer. Hit the link Scale up your site - add a load balancer and choice the last remaining server. Hit Add Loadbalancer and let Cloud 66 do all the heavy lifting. When this is done! Point your traffic to the load balancer. Happy scaling!

alt

Security

Don't forget to add an SSL certificate to your stack. With one click you can add your own SSL certificate or generate a free one using Let's Encrypt. No need to access your servers or doing difficult configuration.

Summary

The combination Cloud 66 and Exoscale give you the power of DevOps right in your hand still comply with all the Swiss legislation or legal issues.

Daniël van Gils

Daniël van Gils is a developer advocate at Cloud 66. He helps other developers craft web apps and container based architectures with ♥, to deploy on any server or public cloud.

Amsterdam & London
Subscribe and get updates

Thank you! We keep in touch.

Have feedback? Please get in touch @cloud66 on Twitter.

Try Cloud 66 for Free, No credit card required