ALL THINGS KUBERNETES

Provisioning a Kubernetes Cluster with Supergiant 2.0.0 Control

Supergiant Control is the “Mothership” or central hub through which all Supergiant tools can be plugged in and controlled. It manages cloud accounts, provisioning, and lifecycle of clusters on your infrastructure, and it allows deployment of applications via HELM. Its deployment and configuration workflows will help you to get up and running with Kubernetes faster.

In the previous tutorial, you learned how to link a cloud account to Supergiant Control. Now let’s learn how to provision your first Kubernetes cluster with this Supergiant tool. By the end of this tutorial, you’ll have a working K8s cluster deployed to a cloud account of your choice.

How Does Cluster Provisioning Work?

Supergiant provisions a Kubernetes cluster on a cloud account of your choice using cluster configuration, provider configuration, and machines configuration that you provide. Cluster provisioning results in the deployment of a working Kubernetes cluster that can be managed using Supergiant Control, Capacity, and Analyze tools or native Kubernetes tools like kubectl .

Prerequisites

You’ll need the following prerequisites to complete examples in this tutorial:

  • A running Supergiant 2.0.0 Control tool. See our SG control installation guide to learn more.
  • An AWS or DigitalOcean cloud account with access to security credentials.
  • An AWS or DigitalOcean account linked to Supergiant Control following the steps in the Linking a Cloud Account tutorial.

After linking your first cloud account, you’ll be automatically taken to the “Create Kubernetes Cluster” page. If you stopped at this step last time, you are still able to create a new cluster by clicking the “Spin up” button on the Home Page.

Supergiant: spinup cluster button

Step #1 Configuring a Cluster

Clicking the “Spin Up” button will take you to the “Create Kubernetes Cluster” page. The cluster provisioning process is handled by the Cluster Provisioning Wizard. The entire process from configuring to spinning up your K8s cluster takes five steps (see the image below):

  • Name and Cloud Account — selecting a cloud account and naming the cluster.
  • Cluster Configuration — setting cluster-specific configs like K8s, Flannel, Docker versions, etc.
  • Provider Configuration — setting provider-specific options like VPC, CIDR range, etc. Each provider has its unique list of such options.
  • Machine Configuration — configuring master(s) and node(s) of your Kubernetes cluster, including the machine CPU and RAM. Each cloud provider offers its unique list of supported machine types.
  • Review — reviewing previous steps of the Wizard and making a final decision.

Now, let’s walk you through all these steps focusing on the available configuration options.

Step 1.1 Name and Cloud Account

The first thing you need to do is to give a name to your cluster and select a cloud account to which to deploy it. A cluster name allows alphanumeric characters and a dash (-), should start with a letter, and must contain no more than 12 characters. 

Supergiant Control: Cluster Wizard 1

After configuring this, click “Next” to go to Cluster Configuration.

Step 1.2 Cluster Configuration

During this step, you can configure cluster-specific options like K8s, Flannel, and Helm versions, etc.

Supergiant Control: Cluster Wizard 2

 

The available cluster configuration options include:

  • K8s version — a Kubernetes version used by the cluster. Default: 1.11.1
  • Flannel version — a Flannel version for creating an overlay network for your cluster. Default: 0.10.0
  • Helm Version — a version of the Helm tool used to deploy Helm charts in your cluster. Default: 2.11.0
  • Docker version — a version of Docker container runtime for managing containers in your cluster. Default: 17.06.0
  • Ubuntu version — the Ubuntu distribution used as an OS for machines in your cluster. Default: xenial
  • Network Type — a network type used in your cluster. Default: vxlan
  • CIDR — a CIDR range used for your cluster. Default: 10.0.0.0/16
  • Operating system — an OS used in machines of your cluster. Default: Linux
  • Arch — a processor architecture of the machines of your cluster. Default: amd64

After configuring this, click “Next” to go to the Provider Configuration.

Step #1.3 Provider Configuration

Each cloud provider creates machine instances for your master(s) and nodes (s) with specified security credentials, network settings, etc. The list of these settings differs across cloud providers. 

Supergiant Control: Cluster Wizard 3

 

Below we list configuration options for the AWS cloud provider: 

  • Region — an AWS region where you deploy a cluster. Example: eu-west-1
  • Availability Zone — an AWS Availability Zone in the region to which you deploy a cluster. Example: eu-west-1b
  • VPC ID — an ID of a virtual private cloud (VPC)  dedicated to your AWS account. Default: “default”
  • VPC CIDR — a range of IPv4 addresses for the VPC in the form of a Classless Inter-Domain Routing (CIDR) block. Default: 10.2.0.0/16
  • Subnet ID — an ID of a subnet in your VPC. Default: “default”
  • Master’s Security Group ID — an AWS Security Group for managing inbound and outbound traffic to the master. Default: leaving the field blank will create a new Security Group.
  • Node’s Security Group’s ID — an AWS Security Group for managing inbound and outbound traffic to the nodes in your cluster. Default: leaving the field blank will create a new Security Group.
  • Public Key — A public key from the AWS account’s cryptographic key pair you generated.

After configuring these fields, click “Next.” This will bring you up to Machine configuration.

Step #1.4 Machine Configuration

We are now ready to select machine types for master(s) and node(s) in your Kubernetes cluster.

Supergiant Control: Cluster Wizard 4

 

Configuring each master or node involves several steps:

  • First, select a machine type from the list of machine types supported by your cloud provider.
  • Next, assign a role to that machine in the cluster (Master or Node). Note: for the master, we recommend using machine instances with a size greater than 2GB. This is a “4GB” instance for the DigitalOcean and “t3.medium” for AWS.
  • Specify how many masters/nodes you want to deploy by setting they Q-ty field. If you choose the quantity of masters, make sure that it’s an odd number. This is needed for the etcd database quorum.

Supergiant Control lets you add as many nodes you want. You can add more nodes by clicking the “Add more machines” button. If you made a mistake, you can always delete the node/master and begin from scratch. Once you have all your masters and nodes configured, click “Next,” and you’ll be taken to the last step of the Wizard — Cluster Review.

Step #1.5 Cluster Review 

At this stage, you can review all the settings you made and go back to any step if you need to modify them.

Supergiant Control Wizard: Review

In the image above, you can see a settings summary for the Cloud Account, Cluster Configuration, Provider Configuration, and Machine Configuration.

As you see, each machine name follows the following format:  Number of Instances X Machine Type (Machine Role). For example, 1 X t2.small (Master) means that we are going to spin up a cluster with one master of the t2.small AWS instance type.

If you are satisfied with this cluster configuration, go ahead and click the “Create” button. This will start the cluster deployment process that has two steps: spinning up the master and creating nodes.

Step #2 Provisioning the Cluster

The first stage of the cluster provisioning process is Supergiant Control creating a Kubernetes master(s). This will take some time, depending on the number of masters you specified. 

Supergiant: Cluster Provisioning

As Supergiant does provisioning, you can click the Checkbox icon to see more details:

Supergiant: Cluster Provisioning Tasks

The dialogue above displays all tasks that need to be completed to deploy a master. As you see, right now Supergiant is working on networking (the task has the yellow “executing” status). Other tasks such as installing Flannel and creating certificates are awaiting their turn. All completed tasks are marked “Success” in the task execution list, as you see in the image above.

Also, you can track real-time logs by clicking “>-” button in the same dialogue. Each cluster creation task will have its logs displayed. In the log output below, you can see that the master has been successfully spun up and that Supergiant is now  configuring SSH.

Supergiant: creating cluster logs

 At each stage of the process, you can click “Cancel.” This will stop the cluster creation and all infrastructure created up to that moment will be destroyed.

After the master has been deployed, Supergiant will start provisioning nodes. This will also take some time (depending on the number of machines spun up), so let’s explore the dashboard. As the cluster is being deployed, you can click on the Home link to see its current state.

Cluster Provisioning: Home Page

Here, you can see a big Cluster Icon with a numerical value (1 in our case). This value indicates that it’s the first cluster we created. If we had three clusters deployed, for example, we would have three icons numbered from 1 to 3, indicating the order in which they were deployed.

You can also open a table view of the cluster by clicking “three lines” icon at the top right corner of the screen.

Supergiant: provisioning cluster table

The table displays the cluster state (currently, it is “Provisioning“), cloud account, region, CPU, RAM, Nodes, K8s version, and other settings we specified in the Wizard. You can click on the cluster icon to go back to the previous screen.

Once the cluster is spun up, you’ll be forwarded to the Cluster Details page with the details of the newly created cluster.  At the top of this page, you can see a “Gathering usage data” title. This title indicates that Supergiant is waiting for Prometheus to gather cluster usage data such as CPU and RAM and display it. It may take up to 2-5 minutes for Prometheus to do this, but once it does you’ll see the CPU and RAM usage icons.

Supergiant: Cluster Resource Usage Stats

This animation allows you to see the percentage of resources used both numerically and graphically. The RAM usage line is filled with the bright blue color to 18.5% of usage,  and the CPU usage line is filled with the bright red to indicate 7.7% of CPU usage.

Below this animation, you can see two tables: the Machines Table and the App Table.

Supergiant: Cluster Details Page

The Machines Table shows the list of machines deployed in your cluster. Each machine row has the following cells:

  • State (e.g., “Active”, “Provisioning” etc.)
  • Role — the machine’s role in the cluster. E.g Node or Master.
  • Size — the machine’s size (e.g., 4 GB)
  • Name — the machine’s name.
  • CPU — current CPU usage.
  • RAM — current RAM usage.
  • Region — a region where the machine is deployed.
  • Public IP

If you have many nodes in your cluster, you can use the “Items per Page” feature to set how many machines to display on one page.  

As you see in the image above, Prometheus has successfully populated the CPU and RAM statistics for each machine in the table as well. Please note that the table shows each individual resource (CPU or RAM) usage for each node and master, and the graph above shows the average consumption for the cluster.

Below the Machines Table, you can see the Apps Table. Whenever you add apps, they will show up in this table. Right now, we have Prometheus monitoring agent installed, which is used by Supergiant by default to collect metrics from the cluster.

Each app entry has the following fields:

  • Status — the status of the app. E.g “Deployed”
  • Name – the app’s name
  • Chart — a Helm chart used to deploy the app
  • Chart Version — a Helm chart’s version
  • Version — a version of the modification of that chart
  • Last deployed — the time when the app was last deployed

Step #3 Deleting a Cluster 

If you want to delete a cluster, click the Delete icon at the bottom left of the page. You’ll see a Warning dialogue telling that “Deleting the cluster will remove all resources attached to it and may lead to data loss. Are you sure you want to delete it?” Click Cancel or Delete.

Supergiant: Delete Cluster

 

Clicking delete will start the deletion process. You will not be able to interact with the cluster once you clicked “Delete.” It will be gone.

Conclusion

In this tutorial, you’ve learned how to create and manage your Kubernetes clusters with Supergiant Control. This tool dramatically simplifies the configuration of a K8s cluster and machines running on it. Supergiant automatically handles the communication with the cloud provider of your choice and installation of all required software (e.g., Docker, K8s binaries). The Control’s interactive dashboard allows users to track the process of cluster creation using logs and execution list and revert the process any moment. Once the cluster is deployed, users are provided with the real-time resource usage statistics and can add new nodes to the cluster.

What’s Next?

Learn more about Supergiant toolkit using the following resources:

Getting started with the Supergiant Toolkit

Supergiant Control on GitHub

Supergiant Capacity on GitHub

Supergiant Analyze on GitHub

Supergiant 2.0.0 Documentation

Subscribe to our newsletter