Discover Civo Cloud: a managed Kubernetes based on K3s
Tags: kubernetes, cloud, cncf
Published: 2021-04-06 05:52:18

---
title: Discover Civo Cloud: a  managed Kubernetes based on K3s
published: true
description: 
tags: Kubernetes, Cloud, CNCF
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oz2pa4y0wtazvqgbalvk.png
---

In our daily work, we are using Kubernetes offers like GKE, EKS, Kapsule... and at Stack Labs we recommand their usage. I also like playing with Kubernetes, I like managed Kubernetes cluster, so when I saw the beta program of [Civo Cloud](https://www.civo.com), I asked them quickly if I can test their offer :-) 

# First of all what is Civo Cloud?

It's a managed Kubernetes cluster based on ... [k3s](https://k3s.io/), so unlike others managed Kubernetes offer, this one it's a managed lightweight version.

I had the chance to be one of the selected beta testers. During this [#KUBE100](https://www.civo.com/blog/kube100-is-here) beta program, beta testers could leave feedback and have live support from Civo Cloud developers on Slack.

The beta program is now ended and Civo will launch publicly their offer which is now "production-ready". 
What will be inside this production release?
"A managed Kubernetes, multi-region, multi-version, with high availability, managed persistent storage and few others features." 

And recently, Civo Cloud is officially certified by Cloud Native Computing Foundation (CNCF) as a fully conformant Kubernetes provider.

# Cluster creation

OK, stop the blah-blah!

It's possible to create a cluster through the UI or the CLI, let's start with the UI!

The interface is pretty simple and clear.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v6aamf6qh3edj23oqjhx.png)

We must choose a name, the number of instance, and select the size of our Nodes.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i76jval1nw36q24vqfm6.png)

The price is clearly displayed, it's a good point. We can directly install known tools like Ingress controller (Nginx, Traefik), CI/CD (Argo CD, Jenkins), Prometheus, Jaeger, metrics-server, Sealed-secret... at the creation of the cluster.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/29s4x1tg5ebalxp5zzy3.png)

Ok, let's create it!

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/faco1p9cvbgs0ppbnxvn.png)

In realtime we see the build time remaining and the nodes creations. Most of the time, in less than 2 minutes we have our Kubernetes cluster up and running :-) ... but few times I had "long" creation, cluster stucked in "BUILDING" state. I hope theses problems will solve before the production launch.

I like this user experience, everything is clearly displayed.
About the developer experience, I want to know and control the version of installed tool, so when I see "default version" for Traefik, is not sufficient for me :-).
A new version of the marketplace that will be released "soon", should fix/improve this developer experience and allow to choose version that we want.

# Let's play with it!

## Installation

First of all, we need to install the CLI tool.
Here the install procedure for Mac:

```
brew tap civo/tools
brew install civo
```

## Add API-Key

In order to use the Civo CLI, we need to add our API-Key. In order to get it, we need to go to: [https://www.civo.com/account/security](https://www.civo.com/account/security).

Then we need to add it:
```
$ civo apikey add civo-dev-to xxx
Saved the API Key civo-dev-to as xxx

$ civo apikey current civo-dev-to
Set the default API Key to be civo-dev-to
```

## Kubeconfig

Now it's time to retrieve the kubeconfig file through the CLI (in order to access to the cluster):

```
$ civo kubernetes config my-civo-cluster --save --merge --region NYC1
Merged with main kubernetes config: /Users/aurelievache/.kube/config

Access your cluster with:
kubectl config use-context my-civo-cluster
kubectl get node
```

The `merge` option allows to not erase you existing kubeconfig file but add new information inside it.

Let's switch into this cluster,
with the Kubernetes native command:

```
kubectl config use-context my-civo-cluster
```

or with one of my favorite CLI "kubectx":

```
$ kubectx my-civo-cluster
```
## List available created clusters

```
$ civo kubernetes ls --region NYC1
+--------------------------------------+-----------------+------+--------------+--------+
| ID                                   | Name            | Node | Size         | Status |
+--------------------------------------+-----------------+------+--------------+--------+
| 9be2af57-e483-4946-9027-b8f432daedcf | my-civo-cluster |    3 | g3.k3s.small | ACTIVE |
+--------------------------------------+-----------------+------+--------------+--------+
```

## Show information about our cluster

```
$ civo kubernetes show my-civo-cluster --region NYC1
          ID : xxx-e483-4946-9027-xxx
        Name : my-civo-cluster
       Nodes : 3
        Size : g3.k3s.small
      Status : ACTIVE
     Version : 1.20.0-k3s2
API Endpoint : https://xxx.xx.xxx.xx:6443
   Master IP : xxx.xx.xxx.xx
DNS A record : xxx-e483-xx-xxx-xxx.k8s.civo.com

Nodes:+-------------+--------------+--------+--------------+-----------+------+----------+
| Name        | IP           | Status | Size         | Cpu Cores | Ram  | SSD disk |
+-------------+--------------+--------+--------------+-----------+------+----------+
| master-47fb | xxx.2.xxx.69 | ACTIVE | g3.k3s.small |         1 | 2048 |       25 |
| node-8e81   |              | ACTIVE | g3.k3s.small |         1 | 2048 |       25 |
| node-548b   |              | ACTIVE | g3.k3s.small |         1 | 2048 |       25 |
+-------------+--------------+--------+--------------+-----------+------+----------+

Applications:+-------+---------+-----------+--------------+
| Name  | Version | Installed | Category     |
+-------+---------+-----------+--------------+
| Nginx | latest  | true      | architecture |
+-------+---------+-----------+--------------+
```

## Let's list our nodes

```
$ kubectl get node
NAME                                       STATUS   ROLES                  AGE   VERSION
k3s-my-civo-cluster-67d75a5c-master-47fb   Ready    control-plane,master   27m   v1.20.2+k3s1
k3s-my-civo-cluster-67d75a5c-node-548b     Ready    <none>                 27m   v1.20.2+k3s1
k3s-my-civo-cluster-67d75a5c-node-8e81     Ready    <none>                 27m   v1.20.2+k3s1
```

## And our pods

```
$ kubectl get po -A
NAMESPACE       NAME                                        READY   STATUS      RESTARTS   AGE
kube-system     local-path-provisioner-7c458769fb-vdwdk     1/1     Running     0          29m
kube-system     coredns-854c77959c-2g2f7                    1/1     Running     0          29m
ingress-nginx   svclb-ingress-nginx-controller-k2mv7        2/2     Running     0          29m
ingress-nginx   svclb-ingress-nginx-controller-w2qhb        2/2     Running     0          29m
ingress-nginx   ingress-nginx-admission-create-nfcxv        0/1     Completed   0          29m
ingress-nginx   svclb-ingress-nginx-controller-n8b5c        2/2     Running     0          29m
ingress-nginx   ingress-nginx-admission-patch-jl7qx         0/1     Completed   0          29m
kube-system     metrics-server-86cbb8457f-5tvl7             1/1     Running     0          29m
ingress-nginx   ingress-nginx-controller-7fc74cf778-pwmm2   1/1     Running     0          29m
```

## And now?

The cluster is ready and we can deploy Pod, Secrets, ConfigMaps, Deployment, Jobs or whatever you want ;-).
You can also watch my [video serie about understanding Kubernetes](https://www.youtube.com/channel/UCrRk0kOP58lBMl9B8ZS8Vlg) and execute kubectl commands explained.

## Add more Nodes to our cluster

It's possible to add or delete the number of nodes. Let's scale from 3 to 6 nodes:

```
$ civo kubernetes scale my-civo-cluster --nodes=6 --region NYC1
```

During my tests, on average the scaling did not exceed 5 minutes.

## Delete cluster

Again, the CLI is pretty easy-to-use, in one line we can remove our cluster:

```
$ civo kubernetes remove my-civo-cluster --region NYC1
```

# What about CSI, CRI, CNI?

Kubernetes is an extensibe world. Several interfaces exists  to extend functionalities :).

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mm6yi4xsjkyswxtx91nb.png)

About Civo Cloud, the default Container Network Interface (CNI) is Flannel, and [suggestions are open from users about using other CNIs](https://www.civo.com/account/suggestions/23e46ee6). 

For Container Storage Interface (CSI), currently they only supports "localpath" or "Longhorn", installable through the marketplace is supported. Spoiler alert: Since the 4th of May, a custom CSI driver which will allow a more native experience, should be released.

The Container Runtime Interface (CRI) is fixed as containerd (and no plan to change it for the moment), due to that being k3s default. Civo wants to keep their platform as close to upstream k3s as possible to allow for easy transition from home Rasperry PI k3s clusters/nodes to the Cloud.

# Infrastructure as Code?

As a former Developer and now as a Cloud Engineer, or as I define myself a "Cloud Helper", I don't like "ClickOps" (means click on an UI) but I prefer DevOps, GitOps and IaC (Infrastructure as Code). I love automate things and improve developers & ops daily work, so it's OK to create and handle cluster through an UI, through the CLI but one question I asked when I test civo is: can we do the same things through Terraform?

The answer is yes :-).

An [official Terraform provider](https://registry.terraform.io/providers/civo/civo/latest) exists in Terraform registry you can use:

```
terraform {
  required_providers {
    civo = {
      source = "civo/civo"
      version = "0.9.23"
    }
  }
}

provider "civo" {
  # Configuration options
  token = "my-private-token"
}
```

/!\ You need to install terraform CLI version 0.13+ in order to use Teraform provider's source feature.

All resources managed with this provider are listed on the [Terraform registry](https://registry.terraform.io/providers/civo/civo/latest/docs/resources/kubernetes_cluster). 

# Conclusion

I like the UI for Kubernetes cluster creation. It's simple, easy-to-use, and the cluster creation is fast (the power of k3s).

For the moment two regions are available: "NYC1" in United States and "SVG1" in United Kingdom, I hope more regions will be added in the future.

It's not possible to create another node-pool but I thinks it will be possible in the future too.

The possibility to let's Civo installing tools can help beginners users or users who don't want to manage things on their own, but it could be useful to choose the version we want.

I scaled down the cluster through the UI and feel impressive about how fast it was to scale down 3 to one node, but I had several troubles during cluster creation so I hope performances will be stabilized.

So, in conclusion, I think it could be a good idea to base a managed Kubernetes offer on k3s. It can be a good solution for demos, in order to have multi cloud providers, clusters created on the fly for testing purpose also, or whatever you want to. 
About production usages, my opinion is that the offer it's not mature for the moment, only two regions are available, features will be available in few weeks and months, so let's see how Civo Cloud will evolves! :-)