Deploying a Spring Boot App on Kubernetes
Overview In this post, I will be explaining how to deploy a simple Spring Boot Application onto Kubernetes. I will be using MicroK8s for the Kubernetes environment. For a quick guide on how setup MicroK8s refer here . Spring Boot App Docker Image: Let us create a simple Spring Boot application and dockerize it. The source could be downloaded from github repo here . Build the jar file and then dockerize it. I will be using the docker image from local, we can also push/pull this image from a Docker Repository. Docker command to dockerize the app is: docker build -t basic-microservice:local . Run the command 'docker images' and you should be able to see the docker image ' basic-microservice:local'. I have tagged the image as 'local' and not as latest. This is because, since we are using local images for Kubernetes, MicroK8s has a workaround for using local images. Follow the instructions here , to upload docker image to MicroK8s cache.