public class KubernetesClusterService extends org.apache.camel.support.cluster.AbstractCamelClusterService<KubernetesClusterView> implements org.apache.camel.cluster.CamelPreemptiveClusterService
| Modifier and Type | Field and Description |
|---|---|
protected KubernetesConfiguration |
configuration |
protected KubernetesLockConfiguration |
lockConfiguration |
| Constructor and Description |
|---|
KubernetesClusterService() |
KubernetesClusterService(org.apache.camel.CamelContext camelContext,
KubernetesConfiguration configuration) |
KubernetesClusterService(KubernetesConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
void |
addToClusterLabels(String key,
String value) |
protected KubernetesClusterView |
createView(String namespace) |
Map<String,String> |
getClusterLabels() |
String |
getConfigMapName()
Deprecated.
|
Integer |
getConnectionTimeoutMillis() |
double |
getJitterFactor() |
String |
getKubernetesNamespace() |
String |
getKubernetesResourceName() |
long |
getLeaseDurationMillis() |
LeaseResourceType |
getLeaseResourceType() |
String |
getMasterUrl() |
String |
getPodName() |
long |
getRenewDeadlineMillis() |
long |
getRetryPeriodMillis() |
KubernetesClusterView |
getView(String namespace) |
protected KubernetesLockConfiguration |
lockConfigWithGroupNameAndDefaults(String groupName) |
void |
setClusterLabels(Map<String,String> clusterLabels)
Set the labels used to identify the pods composing the cluster.
|
protected KubernetesConfiguration |
setConfigDefaults(KubernetesConfiguration configuration,
KubernetesLockConfiguration lockConfiguration) |
void |
setConfigMapName(String kubernetesResourceName)
Deprecated.
|
void |
setConnectionTimeoutMillis(Integer connectionTimeout)
Connection timeout in milliseconds to use when making requests to the Kubernetes API server.
|
void |
setJitterFactor(double jitterFactor)
A jitter factor to apply in order to prevent all pods to call Kubernetes APIs in the same instant.
|
void |
setKubernetesNamespace(String kubernetesNamespace)
Set the name of the Kubernetes namespace containing the pods and the configmap (autodetected by default)
|
void |
setKubernetesResourceName(String kubernetesResourceName)
Set the name of the lease resource used to do optimistic locking (defaults to 'leaders').
|
void |
setLeaseDurationMillis(long leaseDurationMillis)
The default duration of the lease for the current leader.
|
void |
setLeaseResourceType(LeaseResourceType type)
Set the lease resource type used in Kubernetes (defaults to 'Lease', from coordination.k8s.io).
|
void |
setMasterUrl(String masterUrl)
Set the URL of the Kubernetes master (read from Kubernetes client properties by default).
|
void |
setPodName(String podName)
Set the name of the current pod (autodetected from container host name by default).
|
void |
setRenewDeadlineMillis(long renewDeadlineMillis)
The deadline after which the leader must stop its services because it may have lost the leadership.
|
void |
setRetryPeriodMillis(long retryPeriodMillis)
The time between two subsequent attempts to check and acquire the leadership.
|
doStart, doStop, getAttributes, getCamelContext, getId, getNamespaces, getOrder, isLeader, releaseView, setAttribute, setAttributes, setCamelContext, setId, setOrder, startView, stopViewbuild, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAttributes, getNamespaces, getOrder, isLeader, releaseView, startView, stopView, unwrapgetCamelContext, setCamelContext, trySetCamelContextprotected KubernetesConfiguration configuration
protected KubernetesLockConfiguration lockConfiguration
public KubernetesClusterService()
public KubernetesClusterService(KubernetesConfiguration configuration)
public KubernetesClusterService(org.apache.camel.CamelContext camelContext,
KubernetesConfiguration configuration)
protected KubernetesClusterView createView(String namespace) throws Exception
createView in class org.apache.camel.support.cluster.AbstractCamelClusterService<KubernetesClusterView>Exceptionpublic KubernetesClusterView getView(String namespace) throws Exception
getView in interface org.apache.camel.cluster.CamelClusterServicegetView in interface org.apache.camel.cluster.CamelPreemptiveClusterServicegetView in class org.apache.camel.support.cluster.AbstractCamelClusterService<KubernetesClusterView>Exceptionprotected KubernetesConfiguration setConfigDefaults(KubernetesConfiguration configuration, KubernetesLockConfiguration lockConfiguration)
protected KubernetesLockConfiguration lockConfigWithGroupNameAndDefaults(String groupName)
public String getMasterUrl()
public void setMasterUrl(String masterUrl)
public Integer getConnectionTimeoutMillis()
public void setConnectionTimeoutMillis(Integer connectionTimeout)
public String getKubernetesNamespace()
public void setKubernetesNamespace(String kubernetesNamespace)
@Deprecated public String getConfigMapName()
getKubernetesResourceName()@Deprecated public void setConfigMapName(String kubernetesResourceName)
setKubernetesResourceName(String)kubernetesResourceName - the resource namepublic LeaseResourceType getLeaseResourceType()
public void setLeaseResourceType(LeaseResourceType type)
public String getKubernetesResourceName()
public void setKubernetesResourceName(String kubernetesResourceName)
public String getPodName()
public void setPodName(String podName)
public void setClusterLabels(Map<String,String> clusterLabels)
public double getJitterFactor()
public void setJitterFactor(double jitterFactor)
public long getLeaseDurationMillis()
public void setLeaseDurationMillis(long leaseDurationMillis)
public long getRenewDeadlineMillis()
public void setRenewDeadlineMillis(long renewDeadlineMillis)
public long getRetryPeriodMillis()
public void setRetryPeriodMillis(long retryPeriodMillis)
Apache Camel