Getting started with Civo and Lens IDE

Girish Nair
CodeX
Published in
8 min readOct 22, 2022

In this article, we will explore how can we create and set up a simple Kubernetes cluster in Civo, and then manage the same from Lens IDE.

Let’s get started!!

What is Civo?

Civo is the first cloud-native service provider powered only by Kubernetes, they promise blazing-fast cluster creation and launch times in just under 2 minutes. Under the hood, it uses a lightweight version of Kubernetes: k3s which is provided by Rancher labs. It offers a very simple and easy-to-use user interface to create and manage your Kubernetes clusters, affordable and transparent pricing options, and also provides a lot of in-built integration options with popular services such as Helm, Traefik, Gitlab, and a lot more to make your life easy when working with Kubernetes clusters and other associated components.

Also, they are very much active and support the open-source and cloud-native community by conducting a lot of events, useful sessions, discussions, etc.

Creating a K8s cluster in Civo

To get started, head on over to their signup page and then create an account in Civo, you might need a credit/debit card to complete the registration process, post which you will receive 250 USD in credits for 2 months to explore and play around with Civo.

Once you have successfully registered and have logged in, from your dashboard, click on the Kubernetes option available in the left pane.

Click on the Launch my first cluster button available, this will open up the below page wherein you can proceed with cluster creation.

Cluster creation is relatively easy, and the entire process only takes about 2–3 minutes which is much quicker than spinning up it in AWS or GKE.

First, we will specify an name for your cluster, in my case: my-cluster and will keep as the no of nodes as 3

Next, I will use the default network and use default firewall, I will update the firewall to include additional TCP ports later.

In the Select Size, will use Standard: Large, we will delete the cluster post-hands-on, so costs should not be an issue.

Finally, in the Marketplace, I will just select a few applications that could be useful — Helm and Kubernetes dashboard, these would be available under the Management section.

Lastly, click on the button “Launch Cluster” to complete the setup, it might take around 2 mins for the complete setup to get completed and our cluster to be up and running.

Once your cluster is running you can just download your kube config file which we will use to connect to the cluster from Lens IDE.

What is Lens, and how to install it?

Lens basically is a kind of amazing open-source IDE that can be used to interact and easily manage multiple Kubernetes clusters with ease.

Lens IDE is a standalone application for macOS, Windows, and Linux operating systems. You can download it free of charge for Windows, macOS, and Linux from the Lens IDE website.

To install Lens, just head on over to their Install page and follow the steps mentioned, installation is pretty straightforward.

Post installation, can you launch Lens IDE on your machine, it might prompt you to log in with your Lens ID which you can create and then proceed. Once you have successfully logged into your Lens IDE, head over to the Catalog option available in the left pane.

First, navigate to the folder where you have saved your kubeconfig file, and then open the kubeconfig file using any text editor such as Notepad++ or VS Code and copy the entire content available in this Kube config file.

Next, come to Lens IDE and hover on the “+” button available in the bottom right corner which will show a few additional options, select the last option “Add from kubeconfig” and then paste the kubeconfig details in the textbox provided and then click on the button “Add Cluster”

The above step will add your Civo cluster in the Clusters section.

Next, just click on the cluster name which will start a connection, authenticate and enable you to interact with your cluster deployed in Civo.

Now, you will be navigated to the cluster overview page.

To check available Node details in the cluster, select the Nodes option

Interacting with the K8s cluster

To interact with our cluster using kubectl commands, we will just use the Terminal option in Lens IDE, just open it up from below.

One amazing feature available in Lens IDE is that when working with multiple clusters, you don't need to open up multiple terminal windows, the terminal window context will automatically change based on the cluster selected in the left pane. For this, you will need to select the option available: “Add to Hotbar”.

Install a Basic Selenium grid in our Civo cluster

Now for demo purposes, we will just see how can we install a basic selenium grid setup using helm from Lens IDE. We will open a terminal window and run the below set of commands to install selenium-grid.

Add docker-selenium helm repo and update

helm repo add docker-selenium https://www.selenium.dev/docker-seleniumhelm repo update

Install selenium-grid

helm install selenium-grid docker-selenium/selenium-grid

Post deployment of the selenium grid via Helm, you will see something as below in your workloads section, which shows the number of pods that are running, deployment objects, replica sets, etc.

Overview page
Pod details
Deployment details
Replica Sets

Similarly, under the Network section, you can view the details of your service objects that are created and running. As you can see the service selenium-hub is exposed as Cluster IP, I would like to change it to a LoadBalancer type, to do so click on the three vertical dot options available under selenium-hub and click Edit, this will open up the .yml manifest file for the selenium-hub service object.

Update the type to LoadBalancer and save the details using Save & Close

It might take up to a few minutes for an external IP to get assigned, using this external IP and port: 4444 we can access our selenium grid, but first, we will need to add port 4444 in our firewall rules, for this head over to civo dashboard page.

In the Cluster information section, select the Firewall link option

On the Firewall page, you can add TCP port: 4444 to the existing rules, in some cases a default firewall rule may have been applied so all the available ports will be opened up for the public, in this case, you might not have to do any changes from your end.

Now, you will be able to access your grid using external IP and port 4444

Next, we will see if we can scale our browser instances using Lens IDE, under Workloads -> Deployments section, select any browser deployment chrome or firefox and click on options, and select Scale.

I will increase the desired number of replicas to 2 using the + button and click the Scale button, it will create a new browser pod — firefox which will be reflected in my grid within a few seconds, Similarly, I can scale up or scale down other browser pods chrome, and edge easily from Lens.

Similarly, under the Cluster section, you can view the health details of your entire cluster: CPU and Memory. It has an inbuilt Prometheus component which is used for monitoring and also enables developers or users to access container logs and shells using few clicks for debugging purposes.

To summarize, Lens provides an amazing IDE experience to interact and easily manage all your Kubernetes clusters and components deployed in any cloud service provider be it Civo, Azure, AWS, or Google Cloud using just the kube config file details.

This is really beneficial for beginners who are looking to explore and learn the various components of the Kubernetes ecosystem and equally useful for much more experienced folks, as it just increases their productivity and helps them immensely with their day-to-day activities which include cluster management, troubleshooting, or monitoring purposes.

With this, I will wrap up this article, hope you found it to be useful, and thanks for reading!!!

--

--