How to Write Runbooks People Can Actually Follow at 3am

We are around the corner of Black Friday and Holiday season, every SRE’s favorite season, because tensions are at an all-time low (wink wink) and Christmas Spirit is all around us.

Also, there is something else that tends to happen around this time - you guessed it - people are reviewing their runbooks! Hurray!

Runbooks are very peculiar artifacts in our industry, as they often suffer from extreme negligence and most are written without people pouring their hearts into the them, which makes them said and abandoned, never to be read.

Read more →

Implementing SLOs Without the Theatre

Every few months someone in a leadership meeting discovers SLOs (Service Level Objectives), and what follows is something along the following lines: A spreadsheet appears where every service gets a row. Every row gets 99.9% if “it’s important” and 99.5 if “it’s not critical” because that looks good, “we will adjust it later”. A dashboard is built, a Confluence page is written, and then nothing happens for about eighteen months until somebody asks why we are still getting paged at 3am for things nobody cares about.

Read more →

Unpopular opinion: Do everything with 3-tier architecture

In the last couple of years, I’ve come to work a lot with microservices and Kubernetes (and who hasn’t?) and the more I did so, the more I started realising that today, projects and architectures are defaulting towards microservices, not even giving a thought should something start as simply as possible, which would be a monolith (yes, you read that right, I just suggested a monolith for your project).

Things do need to scale and bigger projects that cost/make more money should be designed for scale from day one, there is no arguing there.

Read more →

How SQL Injection Works And Why It Still Happens

SQL injection was described publicly in 1998. It has been in the OWASP Top Ten since the OWASP Top Ten existed. The fix is well understood, cheap, and built into every database driver in common use.

But but but…. it’s still breaching companies today, 20+ years later

This isn’t a hard vulnerability to understand or an expensive one to fix. The question worth asking isn’t “what is SQL injection”. It’s “why does a solved problem keep shipping to prod”.

Read more →

Real Value of DevOps

No matter how hard you work in implementing DevOps practices in your organization, there are always questions arising regarding the actual bottom-line value that it brings. Especially in larger organizations, where it’s easier to coast along without being noticed if your work is actually making an impact or not.

Recently I found myself in a position several time to explain to people both in and outside of the Tech industry about DevOps, the value it brings and is it just another trap to milk money off people and companies. So I have decided to make sense of my thoughts and put it all into writing, for future reference to myself and anyone else asking about what is the real value of DevOps.

Read more →

Bringing fresh new look to the site with Hugo

The day has finally come! I have mustered up time, strenght and willpower to move from Wordpress into something more exciting. You might argue that it’s unnecessary and that I could have continued with WP but the truth is that I wanted something more involved where I could get my hands dirty figuring out stuff. You can figure stuff out in Wordpress, edit the theme etc… But I was never a Wordpress fanboy because of bloat and all the PHP. You might think of this as ditching an old boring girlfriend for a new exciting one but…. PHP - do I need any more excuses?

Read more →

SOPS: When you want to commit the secrets to your repo, for some reason

Every team solves secrets the same way, in the same order. First they’re in the repo in plaintext, because it’s day one and there’s one API key (but I hope that by now you know better!). Then someone notices, and they move to environment variables set by hand on the server. Then there are four servers and nobody knows which one has the current value. Then it’s a shared password manager, and deploys involve copy-pasting out of it.

Read more →

Kubernetes Health Probes With Spring Boot 101

Intro

Kubernetes health probes have just become first class citizens in Spring Boot! Just before the release of Spring Boot 2.3, this article appeared on the Spring blog. These are awesome news because now you can leverage the framework and remove all that custom logic for liveness and readiness checks you have written in the past. In this post, let’s see how you can setup this feature in your application.

Create a demo application

For this tutorial, create a simple spring boot web application that fetches some products. We will create a Product domain entity:

Read more →

Inspect JVM running in Kubernetes with VisualVM

Often times, you will run into obscure errors that require you to take a peek under the JVM hood, which in itself can be a daunting task. In this tutorial, we will take a look on how to troubleshoot a running application in a Kubernetes cluster with VisualVM as well as how to inspect Heap Dumps and how to pass them from the container to our machine.

For this example, we have a Hello Spring Boot Application (the code can be found here) that saves a timestamp of each request in memory (in order to provide us some interesting data for us to analyze later on). We will be working hands on with VisualVM so make sure to download it and start it up, it is very straightforward and here is the link. One could also use JConsole for such a task but let’s leave that for some other time.

Read more →

Auto Generate Mysql Tables Startup Spring Data

Why would you want to auto-generate MySQL tables on startup with Spring Data? A lot of times, I will run into a project and see this “smart” way to automate schema and table creation where there is either a sidecar that executes a bash script or even worse, have it in the Dockerfile. As tempting as that hack is, it is totally unnecessary as we have everything we need to do that with out of the box. This is very useful setup as you want your applications to be self sufficient and don’t have to worry about making changes at two places (application and the database).

Read more →

Remote Debug a Spring Boot Application Running in Kubernetes

There will be times when debugging on your local machine just won’t do it due to configs, environments, etc… In that case, wouldn’t it be great you can actually remote debug your Spring Boot app running in your Kubernetes cluster? In this tutorial, we’ll take a look at a pretty straightforward way in debugging Spring applications on Kubernetes. There are certain times when you want to do this, as you might have an integrated K8s setup, with ConfigMaps, Secrets and other services.

Read more →