Tag Archives: springboot

DIY Java & Kubernetes (Videos and Samples)

This year, on three occasions, I presented about Kubernetes and how you can use it on the Google Cloud Platform, or your own home-built cluster.

Kubernetes RaspberryPi cluster
Kubernetes RaspberryPi cluster

 

Two of these presentations were recorded, and are available on youtube. The presentations, alongside with the code samples explained below, can be a great quick-start guide for making Java microservices or apps with Spring Boot and deploying them on a Kubernetes cluster.

The code samples (a bit modified though) are available on github: https://github.com/hsilomedus/kubernetes-samples.
In order to smoothly migrate from a single app deployment and basics of running Kubernetes, to splitting the app into microservices and deploying a full distributed scenario, I made two implementations:
– kub-calublog is a monolithic Spring Boot application which works with in-memory database and represents a very simple blog platform.
– kub-calublog-ui and kub-calublog-service are ‘microserviced’ pieces of the same application which use HATEOAS RESTful calls between them.
– kub-calublog-deployment contain the scripts and resources for deploying the app or services on a cluster. /simple is for basic single app deployement with docker-like commands, while /kubernetes is for the reccomended declarative methods. /kubernetes-arm is just a showcase if a RaspberryPi ARM based deployment is to be done.

Things to do in order to get started:
– Sign up for a Google Container Engine free trial.
– Create a project, allocate machines (up to 4 shared will do)
– Install gcloud SDK on your machine
– Watch the video(s) and experiment on your own, having the samples for help. (make sure that you replace properly the docker.prefix places in both the pom.xml files and deployment scripts)

Videos:
– jPrime ’16: https://www.youtube.com/watch?v=ek2Ydow7Xh8
– Voxxed Days Belgrade ’16: https://www.youtube.com/watch?v=eWDyNrdsPAg

Other resources:
– Devoxx presentation done by Ray Tsang (@saturnism) and Arjen Wassink (@ArjenWassink): https://www.youtube.com/watch?v=kT1vmK0r184
– gcp-live-k8s-visualizer: https://github.com/brendandburns/gcp-live-k8s-visualizer
– Setting up Kubernetes on a RaspberryPi cluster: http://blog.kubernetes.io/2015/12/creating-raspberry-pi-cluster-running.html
– RaspberryPi Kubeternetes stack 3d design: http://www.thingiverse.com/thing:1307094