Deploying Applications to gridscale using Registered Servers

Today we are going to show you how to deploy to gridscale.io 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.

gridscale?

gridscale.io is a Germany-based cloud provider which provides easy provisioning of VPS and support a lot of cool features like real-time provisioning, scaling with zero-downtime, easy price model, intuitive UI and of course hosted in the best Germany-based datacenter.

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

Let do this!

Prerequisite

  • Cloud 66 account - signup here for a two-week free trial account.
  • gridscale account - signup here with a start credit of €10.

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.

Provision the nodes

Sign in with gridscale and create four nodes.

Provision the loadbalancer

Create a new Server for the load balancer. Loadbalancers don't require much power, memory and storage. Choice the lowest option.

alt

Make sure the option connect to the internet is enabled. It's worth to note that Cloud 66 takes care of all the firewalling and security when we are going to manage your hosts.

Choice a storage and make sure your choice Ubuntu 16.04(LTS) image.

alt

Set the root password to easily can access. 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 Server to create the server.

alt

Our first server is created. But is not started yet. Make sure you start your servers.

alt

Provision the Docker nodes

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

alt

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

alt

Provision the Database node

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

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.

alt

Now it's time to log into your Cloud 66 account. Before we create any project, make sure we put our gridscale 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 root and password you set in the gridscale UI. You can find the IP on the dashboard, when you hit the IP it will automagically copied to you clipboard.

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

alt

Update packages and register the server

When you got access to your server the installation needs curl to run the command to register this server. Execute the following commands:

Update the package registry
root@cloud66dockernode2:~# apt update

Install curl
root@cloud66dockernode2:~# apt install curl

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 and start with a deployment of 1 Docker host and 1 Database host. We select registered servers from the deploy to dropdown

alt

We choice dockernode1 from the registered servers.

alt

And we add another server for our MongoDB database. Of course one of our Docker services need access to the internet. Cloud 66 gives you a 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 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. Choice 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.

alt

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 gridscale give you the power of DevOps right in your hand still comply with all the German 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 μ service architectures with ♥, to deploy on any server or public cloud.

Amsterdam & London
Subscribe and get updates

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

Everything you need to build, manage and maintain containers in production on your own servers and any cloud

Try Cloud 66 — 14 Days Free Trial, No credit card required