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 PropertySource
s read from Kubernetes ConfigMap's.- Since:
- 1.0.0
- Author:
- Álvaro Sánchez-Mariscal
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from interface io.micronaut.discovery.config.ConfigurationClient
CONFIGURATION_PREFIX, ENABLED, READ_TIMEOUT
-
Constructor Summary
ConstructorDescriptionKubernetesConfigurationClient
(io.micronaut.kubernetes.client.reactor.CoreV1ApiReactorClient client, KubernetesConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addPropertySourceToCache
(io.micronaut.context.env.PropertySource propertySource) Adds the givenPropertySource
to the cache.@NonNull String
A description that describes this object.org.reactivestreams.Publisher<io.micronaut.context.env.PropertySource>
getPropertySources
(io.micronaut.context.env.Environment environment) Retrieves all of thePropertySource
registrations for the given environment.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.naming.Described
getDescription
-
Field Details
-
CONFIG_MAP_LIST_RESOURCE_VERSION
- See Also:
-
CONFIG_MAP_RESOURCE_VERSION
- See Also:
-
KUBERNETES_CONFIG_MAP_LIST_NAME
- See Also:
-
KUBERNETES_CONFIG_MAP_NAME_SUFFIX
- See Also:
-
KUBERNETES_SECRET_NAME_SUFFIX
- See Also:
-
OPAQUE_SECRET_TYPE
- See Also:
-
-
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 thePropertySource
registrations for the given environment.- Specified by:
getPropertySources
in interfaceio.micronaut.discovery.config.ConfigurationClient
- Parameters:
environment
- The environment- Returns:
- A
Publisher
that emits zero or manyPropertySource
instances discovered for the given environment
-
getDescription
A description that describes this object.- Specified by:
getDescription
in interfaceio.micronaut.core.naming.Described
- Returns:
- The description
-
addPropertySourceToCache
public static void addPropertySourceToCache(io.micronaut.context.env.PropertySource propertySource) Adds the givenPropertySource
to the cache.- Parameters:
propertySource
- The property source to add
-