Class KubernetesConfiguration
- java.lang.Object
-
- io.smallrye.stork.servicediscovery.kubernetes.KubernetesConfiguration
-
- All Implemented Interfaces:
io.smallrye.stork.api.config.ConfigWithType
public class KubernetesConfiguration extends Object implements io.smallrye.stork.api.config.ConfigWithType
Configuration for theKubernetesServiceDiscoveryProviderServiceDiscovery.
-
-
Constructor Summary
Constructors Constructor Description KubernetesConfiguration()Creates a new KubernetesConfigurationKubernetesConfiguration(Map<String,String> params)Creates a new KubernetesConfiguration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetApplication()The Kubernetes application Id; if not defined Stork service name will be used.StringgetK8sHost()The Kubernetes API host.StringgetK8sNamespace()The namespace of the service.StringgetRefreshPeriod()Service discovery cache refresh period.StringgetSecure()Whether the connection with the service should be encrypted with TLS.Map<String,String>parameters()Stringtype()KubernetesConfigurationwithApplication(String value)Set the 'application' attribute.KubernetesConfigurationwithK8sHost(String value)Set the 'k8s-host' attribute.KubernetesConfigurationwithK8sNamespace(String value)Set the 'k8s-namespace' attribute.KubernetesConfigurationwithRefreshPeriod(String value)Set the 'refresh-period' attribute.KubernetesConfigurationwithSecure(String value)Set the 'secure' attribute.
-
-
-
Method Detail
-
type
public String type()
- Specified by:
typein interfaceio.smallrye.stork.api.config.ConfigWithType- Returns:
- the type
-
parameters
public Map<String,String> parameters()
- Specified by:
parametersin interfaceio.smallrye.stork.api.config.ConfigWithType- Returns:
- the parameters
-
getK8sHost
public String getK8sHost()
The Kubernetes API host.- Returns:
- the configured k8s-host, @{code null} if not set
-
withK8sHost
public KubernetesConfiguration withK8sHost(String value)
Set the 'k8s-host' attribute.- Parameters:
value- the value for k8s-host- Returns:
- the current KubernetesConfiguration to chain calls
-
getK8sNamespace
public String getK8sNamespace()
The namespace of the service. Use all to discover all namespaces.- Returns:
- the configured k8s-namespace, @{code null} if not set
-
withK8sNamespace
public KubernetesConfiguration withK8sNamespace(String value)
Set the 'k8s-namespace' attribute.- Parameters:
value- the value for k8s-namespace- Returns:
- the current KubernetesConfiguration to chain calls
-
getApplication
public String getApplication()
The Kubernetes application Id; if not defined Stork service name will be used.- Returns:
- the configured application, @{code null} if not set
-
withApplication
public KubernetesConfiguration withApplication(String value)
Set the 'application' attribute.- Parameters:
value- the value for application- Returns:
- the current KubernetesConfiguration to chain calls
-
getRefreshPeriod
public String getRefreshPeriod()
Service discovery cache refresh period. By default: 5M- Returns:
- the configured refresh-period,
5Mif not set
-
withRefreshPeriod
public KubernetesConfiguration withRefreshPeriod(String value)
Set the 'refresh-period' attribute. Default is 5M.- Parameters:
value- the value for refresh-period- Returns:
- the current KubernetesConfiguration to chain calls
-
getSecure
public String getSecure()
Whether the connection with the service should be encrypted with TLS.- Returns:
- the configured secure, @{code null} if not set
-
withSecure
public KubernetesConfiguration withSecure(String value)
Set the 'secure' attribute.- Parameters:
value- the value for secure- Returns:
- the current KubernetesConfiguration to chain calls
-
-