Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

OSFUSE-466: using clusterIP instead of portalIP (removed in origin 1.4) #6607

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public KubernetesClient getKubernetesClient() throws MalformedURLException {
.withPort(80)
.withNewTargetPort(9090)
.endPort()
.withPortalIP("172.30.17.2")
.withClusterIP("172.30.17.2")
.endSpec()
.build()
).anyTimes();
Expand All @@ -86,7 +86,7 @@ public KubernetesClient getKubernetesClient() throws MalformedURLException {
.withPort(80)
.withNewTargetPort(8080)
.endPort()
.withPortalIP("172.30.17.2")
.withClusterIP("172.30.17.2")
.endSpec()
.build()
).anyTimes();
Expand All @@ -100,7 +100,7 @@ public KubernetesClient getKubernetesClient() throws MalformedURLException {
.withPort(443)
.withNewTargetPort(443)
.endPort()
.withPortalIP("172.30.17.2")
.withClusterIP("172.30.17.2")
.endSpec()
.build()
).anyTimes();
Expand Down Expand Up @@ -128,7 +128,7 @@ public KubernetesClient getKubernetesClient() throws MalformedURLException {
.withPort(8083)
.withNewTargetPort(8083)
.endPort()
.withPortalIP("172.30.17.2")
.withClusterIP("172.30.17.2")
.endSpec()
.build()
).anyTimes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@ public String getServiceURL(KubernetesClient client, Service srv, String service
if (port == null) {
throw new RuntimeException("Couldn't find port: " + servicePortName + " for service:" + serviceName);
}
return (serviceProto + "://" + srv.getSpec().getPortalIP() + ":" + port.getPort()).toLowerCase();

String clusterIP = srv.getSpec().getClusterIP();
if ("None".equals(clusterIP)) {
throw new IllegalStateException("Service " + serviceName + " is head-less. Search for endpoints instead.");
}

return (serviceProto + "://" + clusterIP + ":" + port.getPort()).toLowerCase();
}

public KubernetesClient getKubernetesClient() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public Service getService(String serviceName) {
.withName(serviceName)
.endMetadata()
.withNewSpec()
.withPortalIP(serviceHost)
.withClusterIP(serviceHost)
.withPorts(servicePorts)
.endSpec()
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class URLToConnection {
@Factory
@ServiceName
public URLConnection toUrlConnection(@ServiceName Service srv) throws IOException {
URL url = new URL( "http://" + srv.getSpec().getPortalIP() + ":" + srv.getSpec().getPorts().iterator().next().getPort());
URL url = new URL( "http://" + srv.getSpec().getClusterIP() + ":" + srv.getSpec().getPorts().iterator().next().getPort());
return url.openConnection();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public KubernetesClient getKubernetesClient() throws MalformedURLException {
.withPort(443)
.withNewTargetPort(443)
.endPort()
.withPortalIP("172.30.17.2")
.withClusterIP("172.30.17.2")
.endSpec()
.build();

Expand All @@ -115,7 +115,7 @@ public KubernetesClient getKubernetesClient() throws MalformedURLException {
.withPort(8083)
.withNewTargetPort(8083)
.endPort()
.withPortalIP("172.30.17.2")
.withClusterIP("172.30.17.2")
.endSpec()
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"component": "AppLibrary",
"provider": "fabric8"
},
"portalIP": "172.30.17.9",
"clusterIP": "172.30.17.9",
"sessionAffinity": "None"
},
"status": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"targetPort": 9090
}
],
"portalIP": "172.30.17.203"
"clusterIP": "172.30.17.203"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}
],
"selector": null,
"portalIP": "172.30.17.2",
"clusterIP": "172.30.17.2",
"sessionAffinity": "None"
},
"status": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"component": "AppLibrary",
"provider": "fabric8"
},
"portalIP": "172.30.17.156",
"clusterIP": "172.30.17.156",
"sessionAffinity": "None"
},
"status": {}
Expand All @@ -59,7 +59,7 @@
"component": "AppLibrary",
"provider": "fabric8"
},
"portalIP": "172.30.17.107",
"clusterIP": "172.30.17.107",
"sessionAffinity": "None"
},
"status": {}
Expand Down Expand Up @@ -90,7 +90,7 @@
"component": "CDelivery",
"provider": "fabric8"
},
"portalIP": "172.30.17.139",
"clusterIP": "172.30.17.139",
"sessionAffinity": "None"
},
"status": {}
Expand Down Expand Up @@ -119,7 +119,7 @@
"selector": {
"docker-registry": "default"
},
"portalIP": "172.30.17.53",
"clusterIP": "172.30.17.53",
"sessionAffinity": "None"
},
"status": {}
Expand Down Expand Up @@ -150,7 +150,7 @@
"component": "elasticsearch",
"provider": "fabric8"
},
"portalIP": "172.30.17.153",
"clusterIP": "172.30.17.153",
"sessionAffinity": "None"
},
"status": {}
Expand All @@ -177,7 +177,7 @@
"component": "elasticsearch",
"provider": "fabric8"
},
"portalIP": "None",
"clusterIP": "None",
"sessionAffinity": "None"
},
"status": {}
Expand All @@ -203,7 +203,7 @@
"selector": {
"component": "fabric8Console"
},
"portalIP": "172.30.17.254",
"clusterIP": "172.30.17.254",
"sessionAffinity": "None"
},
"status": {}
Expand Down Expand Up @@ -234,7 +234,7 @@
"component": "fabric8Forge",
"provider": "fabric8"
},
"portalIP": "172.30.17.203",
"clusterIP": "172.30.17.203",
"sessionAffinity": "None"
},
"status": {}
Expand Down Expand Up @@ -265,7 +265,7 @@
"component": "gogs",
"provider": "fabric8"
},
"portalIP": "172.30.17.177",
"clusterIP": "172.30.17.177",
"sessionAffinity": "None"
},
"status": {}
Expand All @@ -292,7 +292,7 @@
"component": "gogs",
"provider": "fabric8"
},
"portalIP": "172.30.17.15",
"clusterIP": "172.30.17.15",
"sessionAffinity": "None"
},
"status": {}
Expand All @@ -318,7 +318,7 @@
"selector": {
"name": "hubot"
},
"portalIP": "172.30.17.236",
"clusterIP": "172.30.17.236",
"sessionAffinity": "None"
},
"status": {}
Expand All @@ -344,7 +344,7 @@
"selector": {
"name": "hubot"
},
"portalIP": "172.30.17.170",
"clusterIP": "172.30.17.170",
"sessionAffinity": "None"
},
"status": {}
Expand Down Expand Up @@ -375,7 +375,7 @@
"component": "influxdb",
"provider": "fabric8"
},
"portalIP": "172.30.17.149",
"clusterIP": "172.30.17.149",
"sessionAffinity": "None"
},
"status": {}
Expand Down Expand Up @@ -406,7 +406,7 @@
"component": "jbpmDesigner",
"provider": "fabric8"
},
"portalIP": "172.30.17.186",
"clusterIP": "172.30.17.186",
"sessionAffinity": "None"
},
"status": {}
Expand Down Expand Up @@ -437,7 +437,7 @@
"component": "kibana",
"provider": "fabric8"
},
"portalIP": "172.30.17.121",
"clusterIP": "172.30.17.121",
"sessionAffinity": "None"
},
"status": {}
Expand Down Expand Up @@ -465,7 +465,7 @@
}
],
"selector": null,
"portalIP": "172.30.17.2",
"clusterIP": "172.30.17.2",
"sessionAffinity": "None"
},
"status": {}
Expand Down Expand Up @@ -493,7 +493,7 @@
}
],
"selector": null,
"portalIP": "172.30.17.1",
"clusterIP": "172.30.17.1",
"sessionAffinity": "None"
},
"status": {}
Expand All @@ -519,7 +519,7 @@
"selector": {
"name": "letschat"
},
"portalIP": "172.30.17.195",
"clusterIP": "172.30.17.195",
"sessionAffinity": "None"
},
"status": {}
Expand Down Expand Up @@ -550,7 +550,7 @@
"component": "orion",
"provider": "fabric8"
},
"portalIP": "172.30.17.163",
"clusterIP": "172.30.17.163",
"sessionAffinity": "None"
},
"status": {}
Expand Down Expand Up @@ -579,7 +579,7 @@
"selector": {
"router": "router"
},
"portalIP": "172.30.17.80",
"clusterIP": "172.30.17.80",
"sessionAffinity": "None"
},
"status": {}
Expand All @@ -605,7 +605,7 @@
"selector": {
"name": "taiga"
},
"portalIP": "172.30.17.251",
"clusterIP": "172.30.17.251",
"sessionAffinity": "None"
},
"status": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public KubernetesClient getKubernetesClient() throws MalformedURLException {
.withNewTargetPort(8080)
.endPort()
.withClusterIP("172.30.17.2")
.withPortalIP("172.30.17.2")
.endSpec()
.build()
).anyTimes();
Expand Down
Loading