REST


YAKC - Yet Another Kubernetes Client
Introduction In this post, I’ll show you how to perform the equivalent to kubectl --from=cronjob/<cronjob-name> <job-name> (manual trigger) from Java using YAKC- Yet Another Kubernetes Client. This performs something similar to what the official Kubernetes Dashboard CronJob trigger action does. CronJob manual trigger Once you’ve deployed a CronJob to your cluster, in most cases it makes sense to trigger a test run. You probably need to check that everything works fine without having to wait for the scheduled time. Starting at version 1.10, Kubernetes offers a way to create a Job from a CronJob using kubectl. This basically translates into […]

Trigger Kubernetes CronJob manually from Java using YAKC


YAKC - Yet Another Kubernetes Client
Introduction In this post, I’ll show you how to perform the equivalent to kubectl rollout restart deployment/$deployment┬á (rolling restart) from Java using YAKC- Yet Another Kubernetes Client. Rollout Restart Starting at version 1.15, Kubernetes offers a new way to restart Deployments, DaemonSets, and StatefulSets using kubectl. You can simply invoke a kubectl rollout restart deployment/$deployment and Kubernetes will restart your application with zero downtime. Before v1.15 you could do something similar by adding an annotation to the Deployment spec template. If we dig into the source code for Kubectl, we’ll find out that what the provided command does is exactly […]

Rollout Restart Kubernetes Deployment from Java using YAKC


Test Pyramid
Introduction In this post we’ll see how to use MockMvc to test Spring endpoints. This is the first post of a series, this post will highlight the advantages of using Spring MVC test framework compared to other ways of testing controller classes and what are the different ways to setup your tests. You can find the source code for this post at GitHub. The project contains a regular MVC controller that forwards requests to a static resource, and two rest controllers that return a list of languages and coffees. MockMvc and the test pyramid In his book, Succeeding with Agile: […]

MockMvc – Spring MVC testing framework introduction: Testing Spring endpoints