Package org.jgroups.protocols.kubernetes
Class KUBE_PING
- java.lang.Object
-
- org.jgroups.stack.Protocol
-
- org.jgroups.protocols.Discovery
-
- org.jgroups.protocols.kubernetes.KUBE_PING
-
- All Implemented Interfaces:
org.jgroups.Lifecycle
public class KUBE_PING extends org.jgroups.protocols.DiscoveryKubernetes based discovery protocol. Uses the Kubernetes master to fetch the IP addresses of all pods that have been created, then pings each pods separately. The ports are defined by bind_port in TP plus port_range.- Author:
- Ales Justin, Sebastian Ćaskawiec, Bela Ban, Radoslav Husar
-
-
Field Summary
Fields Modifier and Type Field Description protected StringapiVersionprotected StringcaCertFileprotected Clientclientprotected StringclientCertFileprotected StringclientKeyAlgoprotected StringclientKeyFileprotected StringclientKeyPasswordprotected intconnectTimeoutprotected booleandump_requestsprotected static shortKUBERNETES_PING_IDprotected Stringlabelsprotected StringmasterHostprotected intmasterPortprotected StringmasterProtocolprotected Stringnamespaceprotected intoperationAttemptsprotected longoperationSleepprotected intport_rangeprotected intreadTimeoutprotected StringsaTokenFileprotected booleansplit_clusters_during_rolling_updateprotected inttp_bind_portprotected booleanuseNotReadyAddresses-
Fields inherited from class org.jgroups.protocols.Discovery
async_discovery, async_discovery_use_separate_thread_per_request, break_on_coord_rsp, cluster_name, current_coord, discovery_req_futures, discovery_rsp_callback, discovery_rsp_expiry_time, is_coord, is_leaving, is_server, max_members_in_discovery_request, max_rank_to_reply, num_discovery_requests, num_discovery_runs, ping_responses, return_entire_cache, send_cache_on_join, sends_can_block, stagger_timeout, timer, transport, transport_supports_multicasting, use_disk_cache, view, WHITESPACE
-
-
Constructor Summary
Constructors Constructor Description KUBE_PING()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringfetchFromKube()voidfindMembers(List<org.jgroups.Address> members, boolean initial_discovery, org.jgroups.util.Responses responses)voidinit()protected booleanisClusteringEnabled()booleanisDynamic()protected List<Pod>readAll()protected voidsendDiscoveryRequest(org.jgroups.Message req)voidsetMasterHost(String masterMost)voidsetMasterPort(int masterPort)voidsetNamespace(String namespace)StringtoString()-
Methods inherited from class org.jgroups.protocols.Discovery
addDiscoveryResponseToCaches, addResponse, addResponse, addressAsString, addToCache, breakOnCoordResponse, breakOnCoordResponse, callFindMembersInAllDiscoveryProtocols, clearRequestFutures, deserialize, discoveryRequestReceived, discoveryRspExpiryTime, disseminateDiscoveryInformation, down, dumpCache, findInitialMembersAsString, findMembers, findTopmostDiscoveryProtocol, getClusterName, getCurrentCoord, getNumberOfDiscoveryRequestsSent, getView, getViewId, handle, handleConnect, handleDisconnect, handleDiscoveryResponse, isCoord, isMergeRunning, marshal, providedUpServices, read, readPingData, resetStats, returnEntireCache, returnEntireCache, sendCacheInformation, sendDiscoveryResponse, serializeWithoutView, setClusterName, staggerTimeout, staggerTimeout, start, startCacheDissemination, stop, up, up, up, useDiskCache, useDiskCache, weedOutCompletedDiscoveryResponses, write
-
Methods inherited from class org.jgroups.stack.Protocol
accept, addr, addr, afterCreationHook, destroy, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, providedDownServices, requiredDownServices, requiredUpServices, resetStatistics, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, statsEnabled
-
-
-
-
Field Detail
-
KUBERNETES_PING_ID
protected static final short KUBERNETES_PING_ID
- See Also:
- Constant Field Values
-
port_range
protected int port_range
-
connectTimeout
protected int connectTimeout
-
readTimeout
protected int readTimeout
-
operationAttempts
protected int operationAttempts
-
operationSleep
protected long operationSleep
-
masterProtocol
protected String masterProtocol
-
masterHost
protected String masterHost
-
masterPort
protected int masterPort
-
apiVersion
protected String apiVersion
-
namespace
protected String namespace
-
labels
protected String labels
-
clientCertFile
protected String clientCertFile
-
clientKeyFile
protected String clientKeyFile
-
clientKeyPassword
protected String clientKeyPassword
-
clientKeyAlgo
protected String clientKeyAlgo
-
caCertFile
protected String caCertFile
-
saTokenFile
protected String saTokenFile
-
dump_requests
protected boolean dump_requests
-
split_clusters_during_rolling_update
protected boolean split_clusters_during_rolling_update
-
useNotReadyAddresses
protected boolean useNotReadyAddresses
-
client
protected Client client
-
tp_bind_port
protected int tp_bind_port
-
-
Method Detail
-
isDynamic
public boolean isDynamic()
- Specified by:
isDynamicin classorg.jgroups.protocols.Discovery
-
setMasterHost
public void setMasterHost(String masterMost)
-
setMasterPort
public void setMasterPort(int masterPort)
-
setNamespace
public void setNamespace(String namespace)
-
isClusteringEnabled
protected boolean isClusteringEnabled()
-
init
public void init() throws Exception- Specified by:
initin interfaceorg.jgroups.Lifecycle- Overrides:
initin classorg.jgroups.protocols.Discovery- Throws:
Exception
-
findMembers
public void findMembers(List<org.jgroups.Address> members, boolean initial_discovery, org.jgroups.util.Responses responses)
- Specified by:
findMembersin classorg.jgroups.protocols.Discovery
-
fetchFromKube
public String fetchFromKube()
-
sendDiscoveryRequest
protected void sendDiscoveryRequest(org.jgroups.Message req)
-
-