How to deploy Kubernetes cluster in Morpheus in 30 minutes

Many companies have the task of rapidly deploying Kubernetes clusters. It’s good when the cluster is created automatically. But it’s even better when a user, for example, a developer, can create a cluster and then manage it “by button”, without involving devops for this. In our cloud lab, we saw how the Morpheus hybrid cloud management platform handles the creation of the Kubernetes cluster: they automated deployment and evaluated the management and scalability of the cluster.


What is Morpheus?

The Morpheus platform is primarily focused on the creation and management of hybrid clouds (Cloud Management Platform, CMP). And the ability to deploy Kubernetes in this application is a bonus for its owners. But since the question of Kubernetes usually sounds one of the first in conversations “beyond the clouds,” we decided to show the whole process from its creation to scaling.

Today, Morpheus is the leader of the Gartner quadrant in its class. We tested the system in our laboratories on private and hybrid clouds and on the background of “classmates” it is distinguished by several features.

For example, Morpheus integrates with a large number of resource providers. Today there are over 80 such opportunities for integration out of the box, and their number is constantly growing.

What functionality is “wired” in Morpheus? Possibility of creating instances, automation of DevOps-processes due to quick configuration and delivery of bare metal, VM and containerized applications. In use, the product simplifies many routine tasks by providing scalability, monitoring, and backup. Morpheus also supports role-based access configuration and resource allocation matching mechanisms. The advantage of this software are tools for optimizing computing resources.

Preparing to create a Kubernetes cluster

Consider the process of creating a Kubernetes cluster on the VMware platform using the cluster instance mechanism. As a result, users of the hybrid cloud will be able to create and scale the Kubernetes cluster using the portal or through the API.

First, let’s understand what instances are and consider the capabilities of the Morpheus library.

Instances

An instance is a set of containers or virtual machines that are associated with one horizontally scalable service. In addition to simple instances (virtual machines, containers, DBMS), Morpheus creates and deploys cluster instances. The diagram below gives an idea of ​​which components a cluster instance is formed from.

As you can see, an instance consists of templates (cluster layouts), and templates, in turn, are associated with nodes (node ​​type). All of the above components are elements of the Morpheus library.

Morpheus Library

Creating your own instance is done using the Library section. The screenshot shows a part of the Morpheus interface that displays all sections of the library.


Instance types stores existing instances, allows you to create new ones and publish them in a directory.

Layouts Designed to create service templates. The template defines the configuration of the future service and the cloud in which the service will be deployed.

Node Types allows you to create virtual images (nodes) from a single source image with a different set of output content. For example, you have the original Centos 7 image used in Node1 and Node2. When calling the template with Node1, the user will receive the Centos 7 service with the Nginx package, when calling the template with Node2 – Centos7 with Apachee.

AT Option types You can create options to add additional metadata to the templates.

Option Lists needed to import option lists from external sources.

File templates contains configuration files that can be used to automate the configuration of services at different stages of deployment.

AT Scripts scripts are created, later they are used for automation. Scripts have a parameter indicating the necessary moment of their launch.

Section Cluster layouts the functionality is similar to Layouts. The difference is that the templates created in Cluster Layouts are used to form cluster instances.

Creating a Cluster Instance

Using the instances and capabilities of the library, you can deploy a Kubernetes cluster.

The first stage: preparing virtual images for master and worker.

Let’s go to the Node Types library section and create two new nodes.

  1. Let’s start with master. The screenshot below shows the settings dialog box. First, set name and short name, as well as the version. In the TECHNOLOGY field, select VMware, this parameter defines the cloud resource for which the image is created. Next, we indicate the image of the operating system – in our example, this is Centos 7 from the Morpheus standard library. And we also determine which scripts will be run to configure and initialize master`a.
  2. For worker, the settings are similar, with the exception of a set of scripts. It’s enough to install Docker and kubeadm, and then run the join script that connects Worker to Master.

The next step is to create a Cluster Layout.

We press the ADD button in the corresponding section of the library, after which the dialog box for setting the new template opens.

  1. Set the name and version of the template and select Kubernetes Cluster in the CLUSTER TYPE drop-down list.
  2. TECHNOLOGY – the resource provider for which this template is intended. Let’s get back to our original outline. The Kubernetes instance has 3 templates. The first two are for AWS and can only be selected if AWS is connected to Morpheus as a managed resource. In our example, VMware vSphere is used as a resource provider, and we select it in the TECHNOLOGY field.
  3. Add virtual images to the template for Master and Worker.

    There is an important point here. In our example, the Node Type for Master and Worker were called Kubernetes Cluster Master Centos (local) and Kubernetes Cluster Worker (local), respectively. To select the desired virtual image, you will need to enter part of its name in the “Search nodes” field, only then a list of available images will appear.

    Next, fill in the Count and Priority fields. Count – the number of nodes of this type. Priority – a value indicating the priority in the deployment queue. The lower the value, the higher the priority. In our example, the value of this parameter for master is 0, and it will be expanded first. And after it 3 workers will be simultaneously deployed.

  4. We save the changes and proceed to the deployment of the cluster.

Now the template is available in the service catalog. Consider the process of ordering the Kubernetes Cluster service, as well as the possibility of scaling it.

Creating a Kubernetes Cluster

Cluster instances are available from the Clusters section of the Infrastructure tab.

  1. Group tab – select a resource group. In our example, it is the only one.
  2. On the Name tab, select the cloud in which the cluster is deployed. For us, this is VMware. We set the cluster name and define the visibility settings (Public – available in all tenants, Private – available only in the tenant of the current user).
  3. Configure tab – here we select the template and cluster configuration. Our cluster instance has 4 templates for the VMware cloud. We use the created “Jet Demo Cluster”.

    PLAN – we define resources for Master.

    VOLUMES – we determine the sizes of partitions, this is a common setting for master and worker.

    NETWORKS – the choice of a cloud provider network. At our booth, she is only one, and we choose her.

    POD CIDR – specify the subnet for PODs.

    WORKER PLAN – we define resources for Workers.

    NUMBER OF WORKERS – three are selected by default, as this number is specified in the corresponding Node Type template. We will not change this parameter.

  4. On the Automation tab, you can optionally select Workflow. In this example, Workflow is not used, so we move on to the summary information about the cluster settings. Check – and click Complete.
  5. Morpheus begins to deploy a Kubernetes cluster. In the selected configuration, the process will take about 30 minutes. After that, the cluster will be available for launching containers with applications.

Cluster deployment process

First, a virtual machine is deployed from the Kubernetes Cluster Master Centos (local) image. Then the master configuration scripts will be run one by one. After the installation and configuration of the master is completed, from the Kubernetes Cluster Worker (local) template, VMs for future workers will be deployed. Next, scripts will be launched again, which will install the necessary components on the worker. After all the images have been deployed, Post Provision scripts will be launched on the workers, connecting them to the cluster.

Cluster deployment steps are illustrated in the diagram:

Cluster Instance Management

Consider the features of the control panel for a deployed instance.

In addition to basic information about the cost of the ordered service and cluster performance, you can get information about the available namespace, as well as create new ones directly from the interface. Information about running services and containers is presented on a special tab.

Cluster scaling

Adding workers to the cluster is quite simple. To do this, select the corresponding menu item on the Actions tab of the cluster instance control panel.

Next, in the dialog that appears, set the configuration and accept the settings. After that, the new Worker will automatically deploy and join the cluster.

***

Creating and scaling Kubernetes clusters in Morpheus is not inferior in its simplicity to specialized applications. We emphasize once again that in this platform this functionality is far from the only one. It is a huge list of supported applications, virtualization platforms and infrastructure services that is Morpheus’s strong point. Moreover, there are both ready-made templates and the ability to create your own library tools and a large number of images, scripts and configuration files available from the box. The tool is quite flexible and, in comparison with competitors, relatively easy to deploy.

Posted by Sergey Vlasov, Jet Infosystems Cloud Design Engineer

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *