1

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?

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Do you then create a directory at the root of your project and place the files inside it? Would you have any examples with multiple profiles?
1

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.

6 Comments

Where do you usually keep Kubernetes .yml? In a "kubenetes" folder within the project, or a repository just to store these files? Você teria algum exemplo?
We don't use kubernetes.yml with our Helm setup. Each app gets it own chart.yml and a corresponding deployment descriptor YAML file (for example, if an app is deployed as a simple service, it gets a service.yml; for our daemon sets, they get a daemonset.yml, etc).
Using this strategy can you continually deploy using the jenkins pipeline?
Yeah, we have a Jenkins job that builds our boot apps and tags and pushes the new Docker images to a repository. All of our Helm charts are source controlled and get packaged into a single tar file we deliver to our customer. We maintain a set of "factory only" Helm charts that setup things we expect to be setup in production (i.e. database credentials, SSL certs, etc).
Do you have an example on github?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.