Introduction

Kontena is a new developer-friendly platform for orchestrating applications that are run on Docker containers. It simplifies deploying and running containerized applications and by leveraging technologies such as Docker and CoreOS on top of UpCloud high-performance infrastructure, it provides a complete and cost-efficient solution for all types of workloads.

In this tutorial, we will show you how to quickly get up and running with Kontena and UpCloud.

1. Sign up to UpCloud

If you haven’t already signed up to UpCloud, you will need to do that before we start using Kontena. Click here to do that (opens in a new window) – we’ll wait here for you!

2. Activate API-access for your user

To allow your user to access the API, it first needs to be given permission by visiting My Account -> User accounts in the UpCloud control panel.

Click Change for the user you wish to give API-access, check the “Allow API connections“-checkbox and hit Save.

We strongly recommend that you add a new user instead of using your main user account, as it allows you to assign specific permissions for increased security.

3. Install Kontena CLI

You’ll need Ruby version 2.0 or later installed on your system. For more details, check the official Ruby installation documentation.

You can install the Kontena CLI using the RubyGems package manager, which is included in Ruby:

gem install kontena-cli

When the installation is complete, you can verify your installation and current Kontena CLI version with the following command:

kontena version

4. Register your Kontena User Account

With Kontena, all users are required to have a personal user account. Kontena is using user accounts to enforce access control and to generate audit trail logs from user actions. Create your own personal user account by running the following command and following the instructions:

kontena register

5. Create Kontena Master

We are now ready to start setting up Kontena. We start by creating the Kontena Master, which will take care of orchestration and provide management for your containers.

$ kontena master upcloud create --username <UPCLOUD_USERNAME> --password=<UPCLOUD_PASSWORD> --ssh-key <PATH_TO_SSH_PUBLIC_KEY>  
  Creating UpCoud server kontena-master-1... done
  Waiting for kontena-master-1 to start... done
  Kontena Master is now running at https://<IP_ADDRESS>
  Use kontena login https://<IP_ADDRESS> to complete Kontena Master setup

<IP_ADDRESS> is the IP-address that was assigned to your newly created UpCloud server.

6. Login to Kontena Master

When the Kontena Master has been successfully created, you can now log in to the Kontena Master with your Kontena User Account and create your administration account:

kontena login https://<IP_ADDRESS>

Please note that the first user to log in will always become the administrator.

7. Create a Kontena Grid

Once logged in, you’ll need to create a Grid that will be used in the next step when installing Kontena Nodes. The Grid is created with the following command:

kontena grid create

You can give the name for your grid as an argument for this command. In the example below, we will create a Grid with a name testing:

$ kontena grid create testing
  Using grid: testing

8. Create your Kontena Nodes

You have now completed the setup of Kontena Master and successfully created a Kontena Grid. It is now time to deploying some Kontena Nodes, that are used to run your containerized workloads.

The process is very similar to creating a Kontena Master and the newly created Kontena Nodes will automatically join the Grid you created in the previous step.

$ kontena node upcloud create --username <UPCLOUD_USERNAME> --password=<UPCLOUD_PASSWORD> --ssh-key <PATH_TO_SSH_PUBLIC_KEY>
  Creating UpCloud server kontena-node-1... done
  Waiting for node kontena-node-1 join to grid testing... done

9. All done!

You have now successfully deployed your Kontena Master with a Grid containing your Nodes on UpCloud! You can verify your setup by running the following command, which will list all the Nodes belonging to the Grid we previously created.

kontena node list

What’s next?

The guys at Kontena has written an excellent tutorial on how to install and run a private Parse server in production, which gives you an excellent introduction on just how easy and developer-friendly Kontena is. And if you want to learn more about Kontena, we highly recommend checking out the official Kontena documentation.