Class KubernetesConfigurationClient

java.lang.Object
io.micronaut.kubernetes.configuration.KubernetesConfigurationClient
All Implemented Interfaces:
io.micronaut.core.naming.Described, io.micronaut.discovery.config.ConfigurationClient

@Singleton @Requires(env="k8s") @Requires(property="micronaut.config-client.enabled",value="true",defaultValue="false") public class KubernetesConfigurationClient extends Object implements io.micronaut.discovery.config.ConfigurationClient
A ConfigurationClient implementation that provides PropertySources read from Kubernetes ConfigMap's.
Since:
1.0.0
Author:
Álvaro Sánchez-Mariscal
  • Field Details

  • Constructor Details

    • KubernetesConfigurationClient

      public KubernetesConfigurationClient(io.micronaut.kubernetes.client.reactor.CoreV1ApiReactorClient client, KubernetesConfiguration configuration)
      Parameters:
      client - An Core HTTP Client to query the Kubernetes API.
      configuration - The configuration properties
  • Method Details

    • getPropertySources

      public org.reactivestreams.Publisher<io.micronaut.context.env.PropertySource> getPropertySources(io.micronaut.context.env.Environment environment)
      Retrieves all of the PropertySource registrations for the given environment.
      Specified by:
      getPropertySources in interface io.micronaut.discovery.config.ConfigurationClient
      Parameters:
      environment - The environment
      Returns:
      A Publisher that emits zero or many PropertySource instances discovered for the given environment
    • getDescription

      @NonNull public @NonNull String getDescription()
      A description that describes this object.
      Specified by:
      getDescription in interface io.micronaut.core.naming.Described
      Returns:
      The description
    • addPropertySourceToCache

      public static void addPropertySourceToCache(io.micronaut.context.env.PropertySource propertySource)
      Adds the given PropertySource to the cache.
      Parameters:
      propertySource - The property source to add