DEV Community

Cover image for Kubernetes for Java Developers - Setup
Sandro Giacomozzi
Sandro Giacomozzi

Posted on • Updated on

Kubernetes for Java Developers - Setup

Kubernetes is a portable, extensible open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available.


The ​​technology area is cyclical, from time to time the same technologies come back, with different names. (Heidemann, Vanei)

If you are over 35, you have seen many technologies being reinvented. In this case, we'll talk about application servers. As we can see in this article of @rafabene. Why Kubernetes is The New Application Server

As developers, we want to run the code on our machine, to have the control in our hands.
But now, applications are not only running on Docker containers. There are a number of things we need to worry about.

In this tutorial you will learn how to prepare the local environment for a kubernetes cluster. This is the first post of a series about Java and Kubernetes.



Docker is an open source software platform to create, deploy and manage virtualized application containers on a common operating system (OS), with an ecosystem of allied tools.


Minikube implements a local Kubernetes cluster on macOS, Linux, and Windows.


The Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters.

VirtualBox (Optional)

The Kubernetes cluster running inside a Virtual Machine

If you don't have any of these tools, this can help you:

GitHub logo sandrogiacom / k8s

Kubernetes resources


Kubernetes development tools

  • Docker
  • Kubectl
  • Minikube
  • Kubens
  • Stern
  • VirtualBox
  • OpenShift

Clone this repository

git clone



sudo apt install make


sudo pacman -S make

Install tools

All tools

make install-all OS=deb

Separate tools


make install-docker OS=deb


make install-vbox OS=deb


make install-kubectl OS=deb


make install-minikube OS=deb


make install-oc OS=deb

Os Types

  • deb: Deabian , Mint, Ubuntu
  • arch: Arch Linux

Check if works


$ minikube version
minikube version: v1.1.1
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.2"...
$ virtualbox

Start minikube

To start minikube, just type minikube start on the terminal.
The command above creates the virtual machine with default values:
If you want to start with different flags, type minikube start -h to complete list

The most important flags, is:

  • --vm-driver: VM driver is one of: virtualbox parallels vmwarefusion kvm xhyve hyperv hyperkit kvm2 vmware none. default "virtualbox"
  • --memory int: Amount of RAM allocated to the minikube VM in MB (default 2048)
  • --cpus int: Number of CPUs allocated to the minikube VM (default 2)
  • --profile: The name of the minikube VM being used. This can be modified to allow for multiple minikube instances to be run independently (default "minikube")

minikube start -p --cpus 2 --memory=4096


minikube -p dashboard

You can use Dashboard to get an overview of applications running on your cluster, as well as for creating or modifying individual Kubernetes resources (such as Deployments, Jobs, DaemonSets, etc).

Create a namespace

It's a good practice to create a namespace for separating your workspace. Type:

kubectl create namespace dev-to

Enable ingress

minikube -p addons enable ingress

Ingress exposes HTTP and HTTPS routes from outside the cluster to services within the cluster. Traffic routing is controlled by rules defined on the Ingress resource.

Stop minikube machine

minikube -p stop

Destroy minikube machine

minikube -p delete


To be continued...

In this tutorial, we learn how to start a local kubernetes cluster and prepare to deploy our own application. In the next post, we will prepare a Java application to be deployed in the Kubernetes cluster.

See you soon.


Top comments (0)