I have a simple Spring Boot app (Spring Boot 3.0.0, Java 17) deployed to Kubernetes. The app is straightforward at the moment. It has a PostgreSQL DB connection with a couple of Flyway migrations and a basic REST controller.
The application starts fine on my machine (MacBook Pro M1 Max), both in the IDE and in a Docker container. I use amazoncorretto:17
as a base image. Docker has more than enough resources.
Docker resources configuration
However, when I deploy the application in a local K8s cluster created with Minikube the application is incredibly slow. Previously, it could become irresponsible with CPU consumption constant at 100%. I could not connect to java process to take a thread dump or a heap dump due to timeouts. Apparently, there is not enough resources for the application. However, I cannot understand why.
Below are a couple of differences between the app in minikube and in IDE.
App start time locally vs App start time in minikube
I started the minikube with the following configuration:
minikube start --cpus 7 --memory 16000 --driver=docker
Resources for the container (I also tried with up to 4 CPUs, same issue):
resources:
limits:
cpu: 2
memory: 3024Mi
requests:
cpu: 1
memory: 1024Mi
I deployed the same configuration to AWS EKS. The application works there.
Is it a known issue with minikube or a misconfiguration? Are there any configuration options that I miss? Are there reliable alternatives to minikube for local development?