Class KubernetesConnectionConfiguration
- java.lang.Object
-
- org.apache.ignite.kubernetes.configuration.KubernetesConnectionConfiguration
-
public class KubernetesConnectionConfiguration extends Object
Configuration for Kubernetes connection.
-
-
Constructor Summary
Constructors Constructor Description KubernetesConnectionConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAccountToken()intgetDiscoveryPort()booleangetIncludeNotReadyAddresses()StringgetMaster()StringgetNamespace()StringgetServiceName()KubernetesConnectionConfigurationsetAccountToken(String accountToken)Specifies the path to the service token file.KubernetesConnectionConfigurationsetDiscoveryPort(int discoveryPort)Specifies the port which is returned to the caller to use for service discovery.KubernetesConnectionConfigurationsetIncludeNotReadyAddresses(boolean includeNotReadyAddresses)Determines whether addresses of not-ready pods should be included.KubernetesConnectionConfigurationsetMasterUrl(String master)Sets the host name of the Kubernetes API server.KubernetesConnectionConfigurationsetNamespace(String namespace)Sets the namespace the Kubernetes service belongs to.KubernetesConnectionConfigurationsetServiceName(String service)Sets the name of Kubernetes service for Ignite pods' IP addresses lookup.voidverify()Verify that configuration is valid.
-
-
-
Method Detail
-
setServiceName
public KubernetesConnectionConfiguration setServiceName(String service)
Sets the name of Kubernetes service for Ignite pods' IP addresses lookup. The name of the service must be equal to the name set in service's Kubernetes configuration. If this parameter is not changed then the name of the service has to be set to 'ignite' in the corresponding Kubernetes configuration.- Parameters:
service- Kubernetes service name for IP addresses lookup. If it's not set then 'ignite' is used by default.- Returns:
thisfor chaining.
-
getServiceName
public String getServiceName()
- Returns:
- Kubernetes service name.
-
setNamespace
public KubernetesConnectionConfiguration setNamespace(String namespace)
Sets the namespace the Kubernetes service belongs to. By default, it's supposed that the service is running under Kubernetes `default` namespace.- Parameters:
namespace- The Kubernetes service namespace for IP addresses lookup.- Returns:
thisfor chaining.
-
getNamespace
public String getNamespace()
- Returns:
- Kubernetes namespace.
-
setMasterUrl
public KubernetesConnectionConfiguration setMasterUrl(String master)
Sets the host name of the Kubernetes API server. By default the following host name is used: 'https://kubernetes.default.svc.cluster.local:443'.- Parameters:
master- The host name of the Kubernetes API server.- Returns:
thisfor chaining.
-
getMaster
public String getMaster()
- Returns:
- Kubernetes master url.
-
setAccountToken
public KubernetesConnectionConfiguration setAccountToken(String accountToken)
Specifies the path to the service token file. By default the following account token is used: '/var/run/secrets/kubernetes.io/serviceaccount/token'.- Parameters:
accountToken- The path to the service token file.- Returns:
thisfor chaining.
-
getAccountToken
public String getAccountToken()
- Returns:
- Kubernetes account token.
-
setIncludeNotReadyAddresses
public KubernetesConnectionConfiguration setIncludeNotReadyAddresses(boolean includeNotReadyAddresses)
Determines whether addresses of not-ready pods should be included. Default is false.- Parameters:
includeNotReadyAddresses- Flag to include not-ready pods.- Returns:
thisfor chaining.
-
getIncludeNotReadyAddresses
public boolean getIncludeNotReadyAddresses()
- Returns:
- Flag include not ready addresses.
-
setDiscoveryPort
public KubernetesConnectionConfiguration setDiscoveryPort(int discoveryPort)
Specifies the port which is returned to the caller to use for service discovery. Defaults to 0.- Parameters:
discoveryPort- Port to use for Kubernetes IP Finder- Returns:
thisfor chaining.
-
getDiscoveryPort
public int getDiscoveryPort()
- Returns:
- Kubernetes IP Finder port.
-
verify
public void verify()
Verify that configuration is valid.
-
-