Spring Boot AOT with GraalVM Native Image: Static and Mostly Static Executables

In this post I want to talk about Spring Boot AOT with GraalVM; I won’t go into the details of GraalVM and how it works but I aim to write something that acts as a reference for building native executables with Dockerfiles. All the examples you will see were tested on: Mac Ventura 13.2.1 M2 pro 16gb RAM Podman VM running with 4 cores and 8gb RAM Podman VM initialized with the “stable” OS image....

May 6, 2023 · 6 min · Justin

Modifying OCI Images the hard way

Lately I have been creating and debugging container images without having the possibility to check the corresponding Dockerfiles. What I will show you today is how we can modify the behaviour of an OCI Image and swap blobs with others. We will start by modifying a Docker Image similar to the one that I have shown here: we will change the entrypoint and then gain confidence for the next activity; in fact we will then create an OCI Image and change a blob....

February 19, 2023 · 13 min · Justin

Relationships between OCI Artifacts in OCI registries

Today we have supply chain artifacts that we didn’t have the last year: gitbom, sbom, claims etc. Today is possible we produce an artifact and that will come with 3x non-deployable artifacts alongside. How do you store them? Do you make up your own storage service ? Do you need to take in account additional costs to run the infrastructure for the storage (and retrieval) of these artifacts? What about OCI registries?...

February 18, 2023 · 6 min · Justin

How to send logs to multiple outputs with Fluentd on Kubernetes (and how to avoid Ruby gems incompatibility)

In this post I will show you how to send Kubernetes logs to multiple outputs by using Fluentd but first, let’s do a recap. On the previous post I wrote about using Fluentd and FluentBit; in particular, I showed you how to use FluentBit for log collecting and forwarding and Fluentd for pushing these logs to a destination: Opensearch. Since Opensearch at the time didn’t have a Fluentd plugin, we had to craft our Dockerfile tailored for our use case by installing Ruby Gems and by specifing the latest Elasticsearch gem compatible with Opensearch....

October 22, 2022 · 8 min · Justin

Secure Your Docker Images With Cosign (and OPA Gatekeeper)

We built CI/CD pipelines so far which have Docker images as output but how we make sure about the provenance of the workload we run on Kubernetes? How can be sure that the containers we are running are run from images built from our pipelines? One way to ensure trust with Docker images is to sign these images. We can sign them during our CI pipeline and then verify the signature at runtime when deploying....

January 19, 2022 · 9 min · Justin

Centralized (multi tenant) Logging with Kubernetes: Part 3

This is a series. You can find part 1 here and part 2 here. On this last post I am going to cover the monitoring (with Prometheus and Grafana) for OpenSearch and Fluentd. FluentD If you recall from part-1, we set up a specific configuration for Prometheus in Fluentd main-fluentd-conf.yaml kind: ConfigMap apiVersion: v1 metadata: name: fluentd-es-config namespace: logging labels: addonmanager.kubernetes.io/mode: Reconcile data: fluent.conf: |-<source> type forward bind 0.0.0.0 port 32000 </source> [....

December 12, 2021 · 3 min · Justin

Centralized (multi tenant) Logging with Kubernetes: Part 2

This is a series. You can find part 1 here and part 3 here. We were left on part-1 with a fully functional log pipeline. As I said, we’re going to check how to achieve a single shared index in OpenSearch. Shared Index If you recall, on the previous part we set a field on each document we were indexing in OpenSearch by leveraging the FluentD record_transformer plugin. main-fluentd-conf.yaml kind: ConfigMap apiVersion: v1 metadata: name: fluentd-es-config namespace: logging labels: addonmanager....

December 8, 2021 · 5 min · Justin

Centralized (multi tenant) Logging with Kubernetes: Part 1

This is a series. You can find part 2 here and part 3 here. Managing multiple Kubernetes clusters is not so easy; even more managing the logs that are produced from these clusters. The architecture that I want to show you is still a WIP but on the right track. Let’s start from this scenario: 15 Kubernetes clusters (that we will call Tenants) where Spring Boot based microservices are running. We need to provide to the developers a central logging dashboard where they can navigate and correlate logs; in this case we will use OpenSearch (formerly known as Open Distro for ElasticSearch)....

November 21, 2021 · 8 min · Justin

Podman

Podman is an OCI Open Containers Initiative specification compatible container-engine part of RedHat Linux which can be used instead of the Docker runtime. Podman in contrast to Docker is daemonless: it interacts directly with the containers, image registry and storage through the runC container runtime process just by using the CLI (podman); you can even alias podman as alias docker=podman without any problem! How to install Podman on MacOs Note: this guide is tested on a Macbook Pro 2019 (Intel)....

September 26, 2021 · 4 min · Justin

How I containerize and deploy Spring Boot applications on Kubernetes

Having to deal with jvm based projects deployed on Kubernetes expose you to a different set of problems: performance, compatibility, logback issues, jvm flags etc. Here I want to show you how I deploy Spring boot (Java 11+) based applications on Kubernetes, starting from the application itself to the deployment and monitoring with Grafana. The application Let’s say we’re dealing with an application that needs to expose http endpoints; first of all we want download from https://start....

September 14, 2021 · 7 min · Justin