Piszki Lab | EN

My case study in the clouds…

CloudStack – Kubernetes plugin

| 0 comments

Most of the IaaS solutions (CloudStack, vSphere, OpenStack, Proxmox etc.), so far focused on virtual machines, very intensively develop support for containerization. The leading standard at the moment is Kubernetes, support for it can be found in VMware vSphere (Tanzu project) and in CloudStack (kubernetes plugin). The approach to containerization in IaaS is more or less the same everywhere, containers run in lightweight VMs, and the IaaS platform is designed to facilitate cluster startup and management. Today we will deal with the latter solution, configure CloudStack step by step and launch a Kubernetes cluster. The CS documentation for version 4.15 is quite detailed and has up-to-date links to the ISO images you need, be sure to read it.

9BBF8AbW_400x400

In the first step, we need to enable the plugin by setting the cloud.kubernetes.service.enabled option to true, then restart all management servers (cloudstack management and usage). You can also turn on the registry, but this is the basic functionality, if we have such an option, let’s run Harbor on our cluster, definitely a different class of solution.

kube0

As you can see in the picture above, the name of the KVM template “K8S-CoreOS” was also entered, which will be discussed below, it is also not worth changing the name of the default network profile (it will be used if the network is not selected), changing this name causes an error when starting the cluster. In the next step, we need to import the ISO file with the supported version of kubernetes. This file contains the appropriate images and software to accelerate the startup of the cluster. We download the available images from this page, at the moment the following versions are supported:

kube0.1

Import the appropriate file in the Images -> Kubernetes ISO section:

kube0.2

After the ISO is downloaded, the status is Ready:

kube0.3

Then we download the CoreOS image file, which in this version is used as a lightweight VM for containerization, in future CoreOS releases it will be replaced by Debian. The files are available at this address, download the template, unpack it and register it as a standard system template. Finally, if we want a standard user to be able to create kubernetes clusters, the CoreOS template must be public.

kube0.4

In the next step, we create an isolated network in which the kubernetes cluster will operate. Although the appropriate form allows you to choose any previously created network, let’s not do that, the whole thing has been prepared for operation in isolated networks. A single network serves one cluster, for many clusters we need many networks (each consumes VLAN).

kube1

This network works just like any isolated network in Cloudstack, we can create additional VMs in it (e.g. if we need a system from which we will manage the cluster at a lower level):

kube2

In the last step, we start our kubernetes cluster. By default, the plugin runs one Master Node and the number of Worker Nodes defined by us. It is also possible to start the cluster in HA mode, then new Worker Nodes are created and appropriate LB rules are created on VR. Within an isolated network, the plugin creates all relevant NAT and FW rules.

kube3

kube4

Such clusters can be run at any level, e.g. a regular user can include it as part of his project. All cluster-enabled VMs are clearly visible and can be managed individually.

kube5

All the necessary information is clearly provided in the Access tab, here we can download the kube.conf file and download kubeadm directly:

kube6

The cluster automatically starts Kubernetes Dashboard UI, in UI CloudStack we have information on how to connect to it:

kube7

kube8

As you can see, the whole solution is very simple, in just a few steps we have the first kubernetes cluster running. It should only be remembered that the whole solution is behind the virtual router, when running applications inside the cluster, remember to open the correct ports on the firewall.

 

 

Rate this article:

Author: Piotr Pisz

Computer always, since I got a Commodore 64 at the end of primary school, through his beloved Amiga and Linux infinite number of consoles, until today, fully virtual day. Since 2001, Unix/Linux Systems Administrator, for seven years a faithful companion and protector of Solaris system, until his sad end. In the year 2011 came in the depths of virtualization, then smoothly ascended into the clouds and continues there today. Professionally working as Systems Architect in the Polish Security Printing Works.

Leave a Reply

Required fields are marked *.


.

Enjoyed the post? Support Piszki Lab | EN, click on the AD! :-)

.