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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface io.micronaut.discovery.config.ConfigurationClient
CONFIGURATION_PREFIX, ENABLED, READ_TIMEOUT -
Constructor Summary
ConstructorsConstructorDescriptionKubernetesConfigurationClient(io.micronaut.kubernetes.client.reactor.CoreV1ApiReactorClient client, KubernetesConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddPropertySourceToCache(io.micronaut.context.env.PropertySource propertySource) Adds the givenPropertySourceto the cache.@NonNull StringA description that describes this object.org.reactivestreams.Publisher<io.micronaut.context.env.PropertySource>getPropertySources(io.micronaut.context.env.Environment environment) Retrieves all of thePropertySourceregistrations for the given environment.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 thePropertySourceregistrations for the given environment.- Specified by:
getPropertySourcesin interfaceio.micronaut.discovery.config.ConfigurationClient- Parameters:
environment- The environment- Returns:
- A
Publisherthat emits zero or manyPropertySourceinstances discovered for the given environment
-
getDescription
A description that describes this object.- Specified by:
getDescriptionin interfaceio.micronaut.core.naming.Described- Returns:
- The description
-
addPropertySourceToCache
public static void addPropertySourceToCache(io.micronaut.context.env.PropertySource propertySource) Adds the givenPropertySourceto the cache.- Parameters:
propertySource- The property source to add
-