Skip to content

Commit 8b71125

Browse files
committed
KUBERNETES_USE_NOT_READY_ADDRESSES functionality
fixes #77
1 parent 2566982 commit 8b71125

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

README.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ namespace `"default"` will be returned.
171171

172172
| split_clusters_during_rolling_update | KUBERNETES_SPLIT_CLUSTERS_DURING_ROLLING_UPDATE | During the Rolling Update, prevents from putting all Pods into a single cluster
173173

174+
| useNotReadyAddresses | KUBERNETES_USE_NOT_READY_ADDRESSES | True if initial discovery should take unready Pods into consideration. Default is `true`.
175+
174176
|===============
175177

176178

src/main/java/org/jgroups/protocols/kubernetes/KUBE_PING.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,12 @@ public class KUBE_PING extends Discovery {
105105

106106
@Property(description="The standard behavior during Rolling Update is to put all Pods in the same cluster. In" +
107107
" cases (application level incompatibility) this causes problems. One might decide to split clusters to" +
108-
" 'old' and 'new' during that process", systemProperty="SPLIT_CLUSTERS_DURING_ROLLING_UPDATE")
108+
" 'old' and 'new' during that process", systemProperty="KUBERNETES_SPLIT_CLUSTERS_DURING_ROLLING_UPDATE")
109109
protected boolean split_clusters_during_rolling_update;
110110

111+
@Property(description="Introduces similar behaviour to Kubernetes Services (using DNS) with publishNotReadyAddresses set to true." +
112+
"By default it's true", systemProperty="KUBERNETES_USE_NOT_READY_ADDRESSES")
113+
protected boolean useNotReadyAddresses = true;
111114

112115
protected Client client;
113116

@@ -217,7 +220,7 @@ public void findMembers(List<Address> members, boolean initial_discovery, Respon
217220
if(log.isTraceEnabled())
218221
log.trace("%s: hosts fetched from Kubernetes: %s", local_addr, hosts);
219222
for(Pod host: hosts) {
220-
if (!host.isReady())
223+
if (!host.isReady() && !useNotReadyAddresses)
221224
continue;
222225
for(int i=0; i <= port_range; i++) {
223226
try {

0 commit comments

Comments
 (0)