In this post we will be test driving Civo's new managed Kubernetes service, which is powered by k3s from Rancher.

Note, that this is the first k3s managed offering which is currently (2020/05) in beta, which is pretty awesome if I have to admit!

k3s vs k8s

So you might be asking:

>> "What's the difference between Kubernetes (k8s) and the k3s distribution of Kubernetes?"

Andy Jeffries from Civo, published a fantastic article which goes into detail on the differences between k3s and k8s. I highly recommend you check out his article:

Pre-Requirements

If you don't have a Civo account, at the time of writing you can get $50 in credit when you sign up

E43B94B1-2B62-4859-99BC-A17D6E77FB95

At the time of writing Civo is now accepting beta applications to test-drive the world's first k3s powered, managed kubernetes service:

8A9A29A7-F262-4A60-B684-F74D6A5C30DE

If you are interested, have a look at their tweet:

Test Drive

I was pretty amped when I got a mail from them saying that I got selected to join their #KUBE100 beta program πŸŽ‰ .

So I'm heading over to https://www.civo.com and I logged on, Kubernetes is on my left hand side which will look like this:

8F51DF64-1044-4908-9CD7-37F3D76A9C7E

I'm creating a new kubernetes cluster named "k3s-demo" which will have 3 worker nodes:

CB5F8324-3C43-47AC-8046-3FC5AF3E82F9

The next section makes me really excited.. The marketplace! Before launching your cluster, you can select which applications you want to bootstrap onto your cluster during your deployment.

So for demonstration, let's select MariaDB to be deployed to our kubernetes cluster:

E54DEAC6-6094-4B93-A4F3-B0A42EB5CFDB

After selecting create, you will see the progress of your deployment:

B233007C-2B26-40A6-BDEF-D835FF1166EE

Not even 2 minutes and my cluster was ready! Click on download to download your kubeconfig:

B3D5724F-42BA-4AD6-AF85-7589CD73C348

After your kubeconfig has been downloaded, move it into your expected kubeconfig location:

$ cluster_name=k3s-demo
$ mv ~/Downloads/civo-${cluster_name}-kubeconfig ~/.kube/config

Now that our config is in place, we can interact with kubectl to show the nodes:

$ kubectl get nodes
NAME               STATUS   ROLES    AGE    VERSION
kube-master-e106   Ready    master   106s   v1.14.6-k3s.1
kube-node-2165     Ready    worker   87s    v1.14.6-k3s.1
kube-node-907b     Ready    worker   93s    v1.14.6-k3s.1

Let's have a look at our pods:

$ kubectl get pods
NAME                       READY   STATUS    RESTARTS   AGE
mariadb-686b488ff9-fp8vv   1/1     Running   0          3m37s

As we can see mariadb is running, let's get the root password for mariadb:

$ kubectl describe pod mariadb-686b488ff9-fp8vv                                                                                                                               Name:           mariadb-686b488ff9-fp8vv
Namespace:      default
...
    Environment:
      MYSQL_ROOT_PASSWORD:  8OFxFRrrOL4Yhp56rJCnsk1o6TCG55
...

And now, let's logon to MariaDB with our root user and password:

$ kubectl exec -it mariadb-686b488ff9-fp8vv -- mysql -u root -p8OFxFRrrOL4Yhp56rJCnsk1o6TCG55

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.4.7-MariaDB-1:10.4.7+maria~bionic mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>

Pretty sweet right!

Cluster Administration with the CLI

If you are a cli fanatic like myself and want to do everything with the cli, have a look at this awesome Kubernetes Cluster Administration Blogpost using Civo CLI, written by Kai Hoffman

What do you think?

I think this is a fantastic managed kubernetes service offering. The marketplace is really cool, and you can contribute to github.com/civo/kubernetes-marketplace to add more applications to the marketplace.

K3s on itself is awesome and super lightweight and combining a amazing piece of software with a amazing cloud provider, I think is a winning combination by itself!

Thank You

Thanks for reading. If you would like to check out more of my content, check out my website at ruan.dev or follow me on Twitter @ruanbekker

Resources

Check them out: