Deploy the Spring boot with Kubernetes

9/15/2019

I am starting the implementation in the project where I work, but I had some doubts.

  1. I have a project with several profiles spring, and for each I may want to have a replicated amount.

    Example:

    • Dev and staging (1 replica)
    • Production (3 replicas)

    How should I handle this scenario, creating a deployment file for each profile?

  2. Where do you usually keep Kubernetes .yml? In a "kubenetes" folder within the project, or a repository just to store these files?

-- Rafael Dani da Cunha
java
kubernetes
spring-boot
spring-cloud

2 Answers

9/15/2019

You should store them with your code in a build folder. If you are deploying on multiple platforms (AKS, EKS, GKE, OpenShift..) you could create a subfolder for each.

The amount of environment specific configuration should be kept to a bare minimum. So I would recommend using some templating for the files in your CI/CD pipeline. (Helm for example)

If you don't want to worry about these files you could look into Spinnaker.

-- Jeff
Source: StackOverflow

9/15/2019

I would look into using Helm charts to manage your deployments. It's how we manage our Spring Boot apps (around 20 on my current project) and lets us inject different environment settings, including profiles, in each phase of deployment (dev, qa, production) using ConfigMaps.

-- Mike
Source: StackOverflow