spring-cloud / spring-cloud/spring-cloud-config

Remove forced profile names

Open
#2,039 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting for votes
Dominant language
Java
Stars
2k
Forks
1.3k
Avg merge
2d 59m
Merged PRs (30d)
16

Description

Problem Description
We use EKS for deployments and our Spring active profile is used for deployment environment definition
However composite config for config service requires composite profile to be activated

spring:
  application:
    name: config-service
  profiles:
    active: composite
  cloud:
    config:
      server:
        composite:
          -
            type: git
            uri: <your_repo_url>
          -
            type: awss3
            bucket: <your_bucket>

if composite profile is not set, it doesn't work.
The same is related to any other config sources apart from git.

For example, if I want awss3 bucket to work, I must set active awss3 profile
Example:

spring:
  application:
    name: config-service
  profiles:
    active: awss3
  cloud:
    config:
      server:
        awss3:
          bucket: <your_bucket>

if awss3 was not set to be active, the config would not take an effect

Suggested solution
Allow usage spring profiles like in any other Spring Boot projects, without specific profiles

Example:

spring:
  application:
    name: config-service
  profiles:
    active: dev
---
spring:
  config:
    activate:
      on-profile: dev
  cloud:
    config:
      server:
        composite:
          -
            type: git
            uri: <your_repo_url>
          -
            type: awss3
            bucket: <your_bucket>

In the example above I would expect the composite setup would be active, but it is not.

or in the following config, I would expect in dev profile aws s3 backend would be active and in qa profile it will use git as a backend

spring:
  application:
    name: config-service
  profiles:
    active: dev
---
spring:
  config:
    activate:
      on-profile: dev
  cloud:
    config:
      server:
        awss3:
          bucket: <your_bucket>
---
spring:
  config:
    activate:
      on-profile: qa
  cloud:
    config:
      server:
        git:
          uri: <your_repo_url>

But this approach doesn't work.

We have 30+ Spring Boot services following a naming convention where the active profile is = to env name
Where Config Service forces to use their own hardcoded profile names instead of the common pattern of Spring Boot profiles usage.

I know that active profiles can be combined through a comma, but in our case, it is not required and only Config Service require this, which feels incorrect approach.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the config-service handles active profiles and selects the composite, AWSS3, and Git backends. Compare that behavior with the issue's dev and qa examples, then inspect the existing configuration coverage before changing anything. Done means backend selection can follow ordinary environment profiles without requiring backend-specific profile names, while existing configurations remain supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, git, java, kubernetes, spring-boot
Domain
backend, cloud, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.