Kubernetes PropertySource implementations
配置 Spring Boot 应用程序最常见的方法是创建一个 application.properties 或 application.yaml 或 application-profile.properties 或 application-profile.yaml 文件,其中包含为你的应用程序或 Spring Boot 初学者提供自定义值的键值对。你可以通过指定系统属性或环境变量来覆盖这些属性。
要启用此功能,你需要将 spring.config.import 应用程序配置属性设为 kubernetes:(在使用 yaml 时用引号转义,例如 "kubernetes:")。当前你无法使用 spring.config.import 指定要加载的 ConfigMap 或机密,默认情况下,Spring Cloud Kubernetes 将根据 spring.application.name 属性加载 ConfigMap 和/或机密。如果未设置 spring.application.name,它将加载名称为 application 的 ConfigMap 和/或机密。
如果你想将 Kubernetes PropertySource`s during the bootstrap phase like it worked prior to the 3.0.x release
you can either add `spring-cloud-starter-bootstrap 加载到应用程序的类路径或将 spring.cloud.bootstrap.enabled=true 设置为环境变量。