spring-cloud-kubernetes
spring-cloud-kubernetes copied to clipboard
Kubernetes PropertySource order
What is the order of Kubernetes PropertySource with respect to the application's application.yml/bootstrap.yml files and config service? This should be documented in the README.
I tried to find something in the spring boot documentation about custom property source order but couldn't find something. So here's what I remember from my own experience:
A custom property source, gets configured by bootstrap.yml and overrides values defined in application.yml. But I may not remember correctly.
@spencergibb: do u have a link to a doc that clarifies that? or do you remember something different?
@spencergibb Bootstrap is loaded first and before application.properties/yaml - http://stackoverflow.com/questions/32997352/what-is-the-diference-between-putting-a-property-on-application-yml-or-bootstrap
Could you please say on which level in respect to boot config order spring-cloud-kubernetes configmap kicks in?
We have issues trying to run app locally and having configmap taking precedence over everything, even command line args.
Probably related to this @Order annotation
I did a quick test and it seems ConfigMapPropertySourceLocator takes priority over the dev tools as well, so I don't see a way to override values defined in the configmap during local development. I think this is an oversight, please correct me if I missed anything.
Given build.gradle
buildscript {
ext {
springBootVersion = '1.5.7.RELEASE'
}
repositories {
mavenCentral()
maven { url 'http://repo.spring.io/plugins-release' }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'org.springframework.boot'/**/
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
compile('org.springframework.cloud:spring-cloud-kubernetes-config:0.2.0.RELEASE')
runtime("org.springframework.boot:spring-boot-devtools")
testCompile("org.springframework.boot:spring-boot-starter-test")
testCompile("junit:junit:4.12")
}
and a simple com.test.App (spring.application.name=myapp)
@SpringBootApplication
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class);
}
}
values defined in myapp configmap are taken over values defined in ~/.spring-boot-devtools.properties