This guide describes how to create your first iMKE project with a first Kubernetes cluster, how to connect to that cluster and how to clean up all resources afterwards.
After logging into iMKE for the very first time, we will see the following window. As a project is required to create our first Kubernetes cluster, we need to click on
Add Project as a very first step:
This opens a window, where we can name the project. In the example, we use
Team Kubernetes. To finish, we click on
Now iMKE creates our project and adds it to the overview. With a click on the entry
Team Kubernetes we enter the project:
This opens a view showing us the project. We find a list of all existing clusters and their users, as well as some other controls.
At the moment, this list is empty until we create our first managed Kubernetes cluster.
To create the cluster, we click on
Create Cluster in the upper right corner:
This opens the first page of the cluster creation procedure. We choose the provider
openstack and one of the three datacenters. In this example, we pick
In the next step, we have to configure the cluster details. In the example, we call our cluster
first-system and select the desired Kubernetes version:
For occasional SSH access to worker nodes, we need can optionally deploy an SSH Key. To add an SSH-Key, we click on
Add SSH key:
After that we can add the SSH Public Key and give it a memorable name:
To allow iMKE to request the required resources from OpenStack, we add our OpenStack credentials now. After that, the contents of
Project is refreshed automatically, and we can choose the OpenStack project we want to run the cluster in:
By adding the credentials and selecting the OpenStack project, we will proceed to the next step. If we do so, a new and dedicated network, subnet and security group will be created for the cluster automatically.
It is also possible to use an existing network to create the cluster. For this to work, we have to select the network and the subnet from the dropdown menu. Those must be attached to a router. Creating a router can be done from the Optimist dashboard or from the OpenStack command line. Please refer to our OpenStack documentation for details how to create the router and attach it.
In the next step, we define how many and what kind of virtual machines will be initially available as worker nodes in the cluster.
First, this so called
Machine Deployment needs a name. For our test cluster we use the random name generator:
Next, we should specify the
Replicas (number of worker nodes in your Kubernetes cluster) and the
Flavor (machine type), which defines the amount of CPU and RAM for each worker node:
Flatcar as the operating system for the worker nodes:
To finish, we click on
Next. After we verified all settings, we click on
Now the cluster is being created. To access the information, we return to the cluster view of the project and click our Cluster’s name:
This will open a page with all cluster details:
To access the cluster, we need to click on the downwards facing arrow in the top right corner.
This way we download a file which is called
kubeconfig in kubernetes jargon. This file contains all end points, certificates and other information about the cluster. The
kubectl command uses this file to connect to the cluster.
To use the
kubeconfig, we need to register it on the console. There are two ways to do this:
kubectlby default tries to use the file
.kube/configin your home directory.
- We can temporarily use the
kubeconfigby exporting it to the environment variable KUBECONFIG
To keep things straightforward and to avoid changing standards on our system, we choose the second method in the example.
For this we need to open a terminal. In the screenshots we use iTerm2 on macOS, but the examples work the same way when using bash on Linux or Windows.
First, we need to find the downloaded
kubeconfig file. Browsers like Chrome or Firefox usually store it in the Downloads folder. The name is constructed from two parts:
- the cluster id.
To register the kubeconfig, we use the following command:
cd Downloads export KUBECONFIG=$(pwd)/kubeconfig-admin-CLUSTERID
Now we can interact with the cluster. The simplest command is: “show all the nodes that comprise my cluster”:
kubectl get nodes NAME STATUS ROLES AGE VERSION musing-kalam-XXXXXXXXX-ks4xz Ready <none> 10m v1.21.5 musing-kalam-XXXXXXXXX-txc4w Ready <none> 10m v1.21.5 musing-kalam-XXXXXXXXX-vc4g2 Ready <none> 10m v1.21.5
To clean up the cluster we created, we need to click
Delete in the iMKE-dashboard:
This opens a window where we need to enter the cluster name to avoid sudden and unwanted deletions:
Since we also want to free up the resources, we leave both check boxes marked. That way, volumes and load balancers provided by OpenStack will be removed as well.