Getting Started Guide

Phil Dougherty
ContainerShip Articles
9 min readMay 31, 2015

Getting Started with ContainerShip Cloud in 10 Steps

This guide will get you up and running with ContainerShip Cloud in 10 easy to follow steps. In it you will create an organization, add a hosting provider, launch a cluster, run a simple blog application, back it up to Cloud, and restore it back to the cluster. Finally you’ll finish up by shutting down the cluster.

1. Create An Account

Visit https://cloud.containership.io and sign up for an account.

CSC Sign Up Page

2. Confirm Your Account

Check your email and click on the confirmation link

3. Login

Login to your new CSC account

4. Create an Organization

In the top right corner, click on the settings button, and go to Organization Settings.

In the Organization Settings page, click on Create Organization, then select the name you want for your Organization.

I’m going to call my Organization “MyTestOrg”, but this could be the name of your company, the name of your project, or really anything at all.

After you click Create, the new organization will be shown in your Orgs list.

5. Add Your Providers

ContainerShip Cloud launches servers onto your existing web hosting provider on behalf of you. Therefore, you need to connect ContainerShip Cloud with your provider before you can start launching anything.

In the Providers view:

  • Click on Add Provider
  • Select the Provider you want to connect to
  • Click on Next Step
We are going to configure DigitalOcean
  • Input the API auth token or keys from your provider. We’ll show you how to retrieve them for DigitalOcean.
  • Click on API in top menu in your DigitalOcean account
DigitalOcean management console
  • Create a new Personal Access Token with Read and Write scope
Generating a DigitalOcean Personal Access Token

Back in ContainerShip Cloud, paste in your new Personal Access Token into the Add Provider input

Inputting DigitalOcean Personal Access Token

DigitalOcean should now be listed under your connected Providers

Our DigitalOcean provider successfully added

6. Create a Cluster

Now that a provider has been added, you can create a cluster.

Every Cluster has Leader and Follower hosts. You can learn more on our official documentation site.

Leaders run the ContainerShip API, handle orchestration, and provide high availability to the rest of the hosts.

Followers are where your containers will actually be launched and run.

  • In the Clusters view, click on Create Cluster and choose DigitalOcean
Choosing which provider to launch the cluster on
  • Select which SSH keys to place on the hosts
  • Decide which DigitalOcean region or data center to launch the cluster in
  • Choose the number of Leader hosts to launch. One is fine for testing, Three is recommended. They can be small hosts without a lot of resources.
  • Choose the number of Follower hosts to launch. These are where your containers will actually run, so you want to use large enough hosts to fit all the software you plan to launch.
Choosing the settings for your cluster

When you have all your settings adjusted, click Create to launch the cluster!

The hosts will begin provisioning, and the cluster will show up the list.

The new cluster is being created

If you want to give the cluster a name that makes it easy to distinguish it from others, click on the cluster, add something to the Name field, and click Update.

Giving our cluster a Name

After about five minutes, all of the hosts will have launched and the Status will change to All systems operational!

At this point you can start managing your cluster and launching containers.

7. Managing Clusters

Now that you have successfully launched your first cluster, you can begin managing it, and then move on to launching applications.

Click on the new cluster you just launched and then click on Manage Cluster. This will redirect you to the Open Source Navigator web interface where you can launch, link, and scale your containerized applications.

The cluster overview page shows you how many hosts make up your cluster, the total resources available in the cluster, and the amount of resources being used, along with the list of installed plugins. Plugins make it easy to extend the core of ContainerShip and add special functionality. We install a few by default that provide built in Service Discovery, hints about the cloud being run on, as well as Navigator itself, the web interface you’re looking at.

The hosts overview page shows you the leader and follower hosts that make up your cluster. If you click on one of them you can see further detail about its provider, data center, resource utilization, containers running on it, and other identifying information.

The applications view shows you all of the containerized applications running on the cluster, as well as their settings like cpus/memory, docker image, name, and how many are running.

The service discovery plugin has automatically launched 1 container on each follower host
Details for the service-discovery application

8. Launching Applications

We’ve been over how to use Navigator to interact with your cluster and view details, now it’s time for you to start launching some applications!

In the Applications view, click on Create Application, and set the configuration options. In this case we will be setting up a simple Ghost blog.

  • Enter a name for the application (ghost)
  • Choose the right Docker image. ContainerShip will help you by searching on DockerHub.
  • Set the Network Mode to either host of bridge
  • Set the amount of CPU shares that each container should be allocated. In this case we want each to get 1/4 of a CPU.
  • Set the amount of memory each container should be allocated in Megabytes.
  • Set the Container Port that the software listens on inside the container. Ghost is set to listen on 2368 so that is what you should set.
  • Set the Host Volume to the location where you would like Ghost’s data to live on the Host System / follower.
  • Set the Container Volume to the location where Ghost will write it’s data inside the container.

Once you have everything set, click create! Now your application should be visible in the list along with the service-discovery application, but will have 0/0 containers running.

In order to actually launch some containers on your follower hosts for this app, you need to scale it up.

To scale up your application, click on the gear icon to the right of the application and choose Scale. A modal will pop up asking you for the number of containers to scale to, choose 1.

ContainerShip will now launch a container for your ghost application on one of the follower hosts. You can click on the application to view details about it’s status. It will stay in state loading until it has fully started, at which point it’s status will switch to loaded.

Now that the application is loaded, you can try to visit it in your browser to see if it’s working.

In order to view the application in your browser, you’ll need a few pieces of information, both of which can be found in the application detail view.

  • The application’s discovery port
  • The public IP address of one of your follower hosts

Open a new tab in your browser and visit http://104.236.235.162:10279 substituting in the correct values for your application.

You should be presented with the welcome page for the Ghost blogging software.

9. Backing Everything Up For Later

Imagine a more complex example where you configured and launched multiple applications on your cluster, or wrote some data into your blog, or stored records in a database. You’d want to have a backup of that data in case things ever took a turn for the worst and you’re getting paged at 4:00AM.

Luckily, with ContainerShip Cloud, it’s possible to snapshot your entire cluster state and all of your persistent data, like configuration, images, and database tables securely.

To create a new backup:

  • Go to the Backups view in ContainerShip Cloud.
  • Click on Create Backup
  • Choose the cluster you want to have backed up
  • Decide whether you want to backup the underlying data, like your DB tables or your images for example.

Your backup will created and will be listed in the table in the Backups view.

Now just as a test, we will go back to our test cluster, and delete the new application we just created called ghost.

Once it has been deleted, you can try to restore your backup to this cluster to see if the application comes back.

The backup of the ghost application will be applied back to the cluster and should start running momentarily.

If you the check blog now using one of the follower IP addresses and the app’s discovery port, you should see it up and running and loading properly.

10. Terminating a Cluster

We’re successfully launched an application for testing, backed it up, and had some fun playing with the simplest features in ContainerShip, so now let’s show how easy it is to shut things down.

  • Click on the edit button next to the cluster you want to terminate
  • Then click on the delete button which will shutdown all of the hosts for the cluster and return it to 0.
  • Once the cluster hosts have been deleted, it will still be listed in your clusters in case you ever way to scale them back up again (in the same edit menu).
  • To permanently remove the cluster from ContainerShip Cloud, just click on the cluster and then click on the detach button.

Thanks for reading this tutorial about getting ContainerShip up and running in 10 easy steps. Please check the documentation for more information. ☺

--

--

Phil Dougherty
ContainerShip Articles

Co-Founder @containershipio, Husband, Systems Engineer, Manager, Pittsburgher, Pitbull lover.