Marcin Praski

ExUnit file placement

I’ve been writing some ExUnit tests recently, and noticed the convention of putting all test files in a directory separate from the library code. This differs from how other systems I know handle unit test file placement: jUnit tests are usually placed in a test package which has identical structure to the src package it […]

Prometheus & Grafana for Elixir

I’ve been lately playing with Prometheus and Grafana in Minikube, in the context of the Elixir deployment from previous posts. This post will show how to configure Prometheus & Grafana deployments, as well as provision a dashboard with interesting metrics for the Elixir app. Prometheus & Grafana Prometheus is platform for centralizing, analyzing and exposing […]

Deploying Elixir in Kubernetes (4/4)

In this part we implement health probes for the Elixir application and configure Ecto migration as a Kubernetes Job. I initially planned to also add Prometheus setup, but that is big enough to warrant its own entry in the future. Health probes A Kubernetes Pod has a precisely defined lifecycle: from pulling the image and […]

Deploying Elixir in Kubernetes (3/4)

In this part we will deploy the sample Elixir app in a Kubernetes cluster using Helm. There are a few prerequisites: Running local cluster in Minikube Installing kubectl, the API server client, and ktx and kns, context and namespace switchers Installing Trow docker repository in the Minikube cluster – see quickstart instructions here Once your […]

Deploying Elixir in Kubernetes (2/4)

In this part I’ll define a Dockerfile for the Elixir project and use it to run the application alongside its dependencies using docker-compose. We’ll introduce an Ecto repo in the domain app and spin up a MySQL Docker container to show the flexibility of docker-compose. Dockerfile First, let’s define the Dockerfile. The first few lines […]

Deploying Elixir in Kubernetes (1/4)

In this series of posts I will describe my efforts to prepare an Elixir application based on the Phoenix web framework for deployment in a Kubernetes cluster. This project is motivated largely by my interest in both technologies and finding a way to bridge them together. At first I’ll describe setting up an Elixir project […]