About this blog

We are experts in deploying code to production in the cloud. We are responsible for doing this hundreds of thousands of times - through automation. Learn some of these best practices here …

Kubernetes with Java - Running in the Cluster

Using Kubernetes API through a Java app from inside the Kubernetes cluster with RBAC

What are we going to do? This post builds on top of Kubernetes with Java - Introduction and Kubernetes with Java - Asynchronous APIs posts which showed us how to interact with the Kubernetes API to list deployment resources and provide an API of our own to list teams and apps belonging to those teams running in the cluster. In this post, we will Configure a spring-boot app to be able to access the Kubernetes API when running inside a Kubernetes cluster Learn how to package up a spring-boot app into an OCI image (aka Docker image) Configure RBAC with Role, RoleBinding, and ServiceAccount so our spring-boot app has the ability to run with only the Kubernetes APIs that we think it should have access to and nothing more Create Deployment and Service resources to deploy our spring-boot app and expose its API within the cluster Prerequisites Access to source code for the project - https://github. [Read More]

Kubernetes with Java - Asynchronous APIs

Choosing between synchronous and asynchronous Kubernetes API in Java

What are we going to do? This post builds on top of Kubernetes with Java - Introduction which relied on synchronous Kubernetes API to get information for apps runnings in Kubernetes cluster. In this post, we will Learn when to use synchronous and when to use asynchronous Kubernetes API mechanisms Learn how to use asynchronous Kubernetes API to exrtact deployments metadata How to use spring-boot profiles to conditionally enable functionality Synchronous vs asynchronous APIs Kubernetes API provides two mechanisms to consume information for the clients. [Read More]

Kubernetes with Java - Introduction

Getting started with the Kubernetes API client libraries for Java

What are we going to do? Learn how to initialize the k8s api client in a java spring-boot application Extract metadata from deployments in a namespace and transform that metadata into new views Prepare you for more sophisticated problem solving using the k8s API in future articles Motivation You have a few dozen different applications (as Kubernetes deployment resources) running in your cluster All of those applications use labels to designate the name of the team that manages that application, and the application name You want to provide APIs that: Lists all teams that have applications running in the cluster Lists all apps that belong to a team Scenario Assumption: you have minikube locally and you don’t already have a namespace called dev. [Read More]