How to Get Started with Platform9 Managed Kubernetes on a Windows Machine
Tags: tutorial, kubernetes, ubuntu
Published: 2020-03-25 15:06:17

The following is a tutorial from the Platform9 technical team.

Platform9 Managed Kubernetes (PMK) is a Kubernetes offering with several distinct advantages, including its ability to spin up a Kubernetes cluster with physical or virtual machines (VM) in a short period of time. This is done with relative ease using what Platform9 calls [BareOS clusters](https://bit.ly/2Ue9tHg). These are the clusters that are formulated via the process of preparing on-premises or public cloud VMs as nodes that can then be used to create clusters via the PMK UI. 

This tutorial, created by the Platform9 technical team, demonstrates this process by creating a single-node Kubernetes cluster using a VM. But the real lessons will be those gleaned from the set-up of your Windows host machine to support this process. The goal of this tutorial is to show you how to create a VM that runs Ubuntu 16.04 (which is supported by PMK), and then show you how to use that VM to create a Kubernetes cluster via the PMK UI. 

To complete this tutorial, you will need the following:

 - A computer running a recent version of the Windows operating system (a machine running Windows 10 is used for this tutorial), Oracle VM VirtualBox for spinning up your virtual machine,
 - A download of the Linux ISO for Ubuntu 16.04, and
 - A free-forever account with [Platform9 Managed Kubernetes](https://bit.ly/3a3YMwu).

So, now that you know what you’re dealing with, let’s get started!

##Installing Oracle VirtualBox on Windows##
The first step in creating your virtual machine is to set up the software that will create and manage it. We’re using Oracle VM VirtualBox, which is very intuitive and, best of all, available as open source. To download the most recent version (6.1.2) for Windows, simply visit the [downloads page](https://www.virtualbox.org/wiki/Downloads) and click on “Windows hosts” below “VirtualBox 6.1.2 Platform Packages.”

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8xgsdx1m5ap5qyp7dd6n.png)

Once the download has finished, you can begin installing and configuring the software. When you open the executable to begin installing Oracle VM VirtualBox, you will be met with a Setup Wizard:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1023m1nejtruee8uiowf.png)

Click <code class="language-plaintext highlighter-rouge">Next</code> on the initial page to progress to the setup portion of the installation. This step will allow you to change the way features are installed and choose the location. For our purposes, the default options will suffice.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1ft3ka3ogynukjtk71xt.png)

Click <code class="language-plaintext highlighter-rouge">Next &gt;</code> to continue. For this tutorial, we will allow the features to be installed in the default manner and at the default location (C:\Program Files\Oracle\VirutalBox).

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/pif98alvah1a56zitov3.png)

The Setup Wizard will give you the option to create shortcuts, start menu entries, etc. Again, we will leave the configuration as it is and click <code class="language-plaintext highlighter-rouge">Next</code> to progress.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/kgplceatztuojyv78qit.png)

On the next screen, click <code class="language-plaintext highlighter-rouge">Yes &gt;</code> to proceed with the installation. After this, you will be met with one more screen, and you simply click <code class="language-plaintext highlighter-rouge">Install</code>. Within minutes, Oracle VM VirtualBox will be completely installed on your machine. Then, you can proceed to the next step - setting up your virtual machine.

##Setting Up Your Virtual Machine##
To begin setting up your Ubuntu instance, you first need to open VirtualBox. When you do, you will be met with the following window:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6wtxwr14gq7jo4dejy20.png)

On the main toolbar running across the top of the Oracle VM VirtualBox Manager window, select <code class="language-plaintext highlighter-rouge">Machine &gt;</code> and <code class="language-plaintext highlighter-rouge">New</code>. This will open a new window where you can begin defining the specifications for your VM.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/a5clvgdi5rucnmqawm9h.png)

You can simply choose the name **TestMachine** and follow along with the same setup as dictated by the image above. I allocated 2 GB of RAM for the VM and chose the option to <code class="language-plaintext highlighter-rouge">Create a virtual hard disk now</code>. After clicking <code class="language-plaintext highlighter-rouge">Create &gt;</code> a virtual hard disk now, be sure to select the hard disk file type, VDI (VirtualBox Disk Image):

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/uyfe2tfyscplp06ayqzv.png)

Clicking <code class="language-plaintext highlighter-rouge">Create</code> will complete the initial setup of your virtual machine.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/d8s4rkbwzldoyora69rv.png)

##Downloading the Ubuntu 16.04 ISO##
You won’t get very far without downloading the [Ubuntu 16.04 ISO](http://releases.ubuntu.com/16.04/). To do so, visit the Ubuntu 16.04 releases page and scroll down to find the correct image. For our purposes, let’s go with “ubuntu-16.04.6-desktop-amd64.iso.” Click on the image to begin downloading.

##Installing Ubuntu 16.04 on Your VM##
Now that you have your Ubuntu 16.04 image, let’s install the OS on your virtual machine. Go back to the Oracle VM VirtualBox Manager and select <code class="language-plaintext highlighter-rouge">TestMachine</code> in the left pane. Then click the button to “Start” your VM:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/opfspsz5d995ohtdrgrk.png)

Next, the VM will start and you will be met with a prompt to request the start-up disk. Browse to the Ubuntu 16.04 ISO that you downloaded in the previous step and click <code class="language-plaintext highlighter-rouge">Start</code>.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/x5vcaenppcuiycw4zhx8.png)

Now let’s install Ubuntu 16.04 on your VM.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/a86u0ycdu5fgvwk2nq2n.png)

Select your preferred language and click <code class="language-plaintext highlighter-rouge">Install Ubuntu</code>. On the next screen, you will be asked if you would like to download updates or install third-party software during the installation. For the purposes of this tutorial, we will leave the boxes unchecked and click <code class="language-plaintext highlighter-rouge">Continue</code>. On the next screen, select the option to “Erase disk and install Ubuntu,” and then click <code class="language-plaintext highlighter-rouge">Install</code>.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zxt8joc63jo3hit0aw5z.png)

The next two steps simply verify your location and keyboard type. Complete these as appropriate and progress to the final step, where you will name the machine and set up your account credentials:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7pqi3v50dd5mgzbfn6ki.png)

After this step, Ubuntu will complete the installation process, and you will have officially set up a virtual machine running Ubuntu 16.04 with VirtualBox.

##Creating a Single-Node Kubernetes Cluster with PMK##
The process for setting up a single-node Kubernetes cluster with your VM via PMK is fairly straightforward. But first, you will need to sign up for the [PMK Free Tier](https://bit.ly/3a3YMwu). Next, you must configure your VM so that you can utilize it as a node within your BareOS cluster. You can do this by logging into your Ubuntu VM, opening a terminal, and executing the following commands:

 - Command to download CLI installer: <code class="language-plaintext highlighter-rouge">curl -O https://raw.githubusercontent.com/platform9/express-cli/master/cli-setup.sh</code>
 - Command to run the CLI installer: <code class="language-plaintext highlighter-rouge">bash ./cli-setup.sh</code>
 - During the installation process, your Platform9 management URL and username will be requested. You must provide these to move forward.
 - Finally, run the following command to prepare your node for use within your cluster: <code class="language-plaintext highlighter-rouge">pf9ctl cluster prep node</code>

When this process completes successfully, you will receive output similar to the following:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5csoplqeax676jz0sand.png)

Now the node will be visible in your Platform9 management console, where it can be viewed by navigating to Infrastructure -> Nodes.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gmppa4sm6tcr7dl6aioo.png)

Finally, by navigating to Infrastructure -> Clusters, you can click Add Cluster and follow the directions there, as well as the [Platform9 documentation to add a BareOS cluster](https://bit.ly/2UheOO8), which will add your VM as a node to complete the deployment of your Kubernetes cluster.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6r4d3hyau0711suc633p.png)