Package io.micronaut.kubernetes.client
Class DefaultNamespaceResolver
java.lang.Object
io.micronaut.kubernetes.client.DefaultNamespaceResolver
- All Implemented Interfaces:
NamespaceResolver
@Singleton
@Requires(env="k8s")
public class DefaultNamespaceResolver
extends Object
implements NamespaceResolver
Default implemention of
NamespaceResolver
. The resolution of namespace is evaluated in this order:
- Value configured by `kubernetes.client.namespace`.
- If the application is running inside a pod then the namespace is read from file `/var/run/secrets/kubernetes.io/serviceaccount/namespace`.
- Namespace is set do `default`.
- Since:
- 3.1
- Author:
- Pavol Gressa
-
Field Details
-
DEFAULT_NAMESPACE
- See Also:
-
NAMESPACE_PATH
- See Also:
-
-
Constructor Details
-
DefaultNamespaceResolver
-
-
Method Details
-
resolveNamespace
Description copied from interface:NamespaceResolver
Resolves namespace.- Specified by:
resolveNamespace
in interfaceNamespaceResolver
- Returns:
- namespace name
-