A first impression of Rust from the perspective of a Go developer

In these uncertain times and multiple months of remote work, at least we have some more time to dive into something new. I have been developing in Go since 2017, learned some TypeScript in the meantime, but few days ago I wanted to get into Rust once again. First time, approximately a year ago I gave up very quickly, realizing that Rust requires lot of time to learn and I didn’t have that much time at the moment. ...

2020-12-26 · 3 min · Boban Acimovic

Automated MySQL MariaDB tables optimization in Kubernetes

Kubernetes simplified applications management a lot and this also applies to databases like MySQL/MariaDB, but lot of DevOps forget to apply traditional maintenance and optimization which is still necessary unless you are using some operator capable of doing so. The optimization method that will be described here applies just to single and master-slave replicated MySQL/MariaDB instances. If you run some clustered version like Galera , you probably have to find another way because of possible consistence and performance problems during the eventual optimization. This method would still work but you may have unpredictable consequences. ...

2020-12-26 · 2 min · Boban Acimovic

Develop Kubernetes native applications in Golang with auto-recompile and auto-restart

Do you develop or plan to develop a Kubernetes native application in Golang, controller or operator? Such application strongly depends on being inside Kubernetes and development outside of Kubernetes may be a real hassle. Usually you have to build an image over and over again and restart the pod (with imagePullPolicy set to Always). This is very boring and time consuming procedure. Two years ago I developed an image to auto-recompile and auto-restart Go application, named go-reflex , but it was intented to be used by docker-compose. Today I gave it a try with Kubernetes, namely with kind (Kubernetes in Docker) and it turned out it works like a charm. In this article I will describe how to set this up and save your time for something creative (i.e. beer drinking). ...

2020-08-28 · 2 min · Boban Acimovic

Traefik 2.2 can again fully utilize Kubernetes Ingress resources

Learn how to setup Traefik 2.2 on Kubernetes and how to automatically get TLS wildcard certificates. Traefik is a modern Web server made in the cloud era so it’s authors define it as a Cloud Native edge router. It is written in Go and it’s maybe not as fast as nginx or HAProxy, but it is fast enough and in the same time it has great features not present in traditional Web servers. These features include automatic care of TLS certificates, nice control panel, support for Docker stacks and Kubernetes, etc. ...

2020-07-31 · 3 min · Boban Acimovic

Using Traefik 2.2 middlewares with Kubernetes Ingress resources

Since Traefik 2.0, this feature was possible just with custom IngressRoute resources, but it is now possible with normal Kubernetes Ingress as well. So, what is the Traefik middleware, anyways? It is a piece of code which is triggered just before the Ingress itself. Here you can find the full list of available directives that you can use to create your middleware. In this article we are going to define two middlewares, one to redirect www.example.io to example.io, so that we make SEO happy and another one for basic authentication. Here is how this would look like using helmfile declaration: ...

2020-07-31 · 2 min · Boban Acimovic

Install cert-manager using helmfile

You may wonder what the heck is helmfile ? Well, I would say what is docker-compose to Docker, this is helmfile to Helm . Basically, it allows us to install the whole stack of applications to our Kubernetes cluster in a declarative way. And you may also wonder why is cert-manager so special? I would say cert-manager itself is not that special Helm chart, but it contains CRD ’s which may be installed either by using value installCRDs=true or by installing them using kubectl apply before you install the chart. ...

2020-07-28 · 2 min · Boban Acimovic

NFS provisioner for your K8S cluster

Do you need ReadWriteMany storage class and your cloud provider doesn’t offer it? According to Wikipedia , Network File System (NFS) is a distributed file system protocol originally developed by Sun Microsystems (Sun) in 1984, allowing a user on a client computer to access files over a computer network much like local storage is accessed. Even though this idea is 35 years old, it is still very useful in your Kubernetes cluster, specially if you need ReadWriteMany storage class. If you are interrested about this, you are probably wondering how to achieve this? ...

2020-07-26 · 1 min · Boban Acimovic

Using kubectl patch in continuous deployment

How to deploy new Docker images to your Kubernetes cluster? Of course, there are many ways and one of the most common ways is to use kubectl set image, for example: 1 kubectl set image deployment/nginx-deployment nginx=nginx:1.17.5-alpine However, what happens if you have more containers in your deployment pod spec? And what if you also have initContainers? Fortunately, kubectl patch can help. Let’s assume we have two containers and one init container. Here is the patch file (patch.yaml) we can use: ...

2019-10-23 · 2 min · Boban Acimovic

New kind on the Block

Few months ago I wrote an article about replacing Minikube with MicroK8s , but now we have even better soluion, kind . Like dind allows running Docker inside Docker containers, kind allows running Kubernetes inside Docker containers. kind basically abstracts nodes as Docker containers and then runs Kubernetes inside. After you install Golang , it is quite easy to install and setup kind: 1 2 GO111MODULE="on" go get sigs.k8s.io/kind@v0.5.1 kind create cluster After some 30 seconds your single node cluster will be ready for development and testing. But that’s not all, kind allows much complex setup, for example three node cluster with one master and two workers. Let’s first create declarative object: ...

2019-10-03 · 1 min · Boban Acimovic

Inexpensive managed Kubernetes solutions

DigitalOcean just got competition from Scaleway with their managed Kubernetes service, Kapsule.

2019-09-26 · 2 min · Boban Acimovic