Cassandra example - Modified line 103 in java/src/io/k8s/cassandra/KubernetesSeedProvider.java to accept the Kubernetes host as an environment variable from the pod template. Compiled the Jar and moved it to image/kubernetes-cassandra.jar. Changed the version number in the pom.xml file.
This commit is contained in:
parent
fa49234b4e
commit
1c01f4ac60
Binary file not shown.
|
@ -2,7 +2,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>io.k8s.cassandra</groupId>
|
||||
<artifactId>kubernetes-cassandra</artifactId>
|
||||
<version>0.0.3</version>
|
||||
<version>0.0.4</version>
|
||||
<build>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
<plugins>
|
||||
|
|
|
@ -100,7 +100,7 @@ public class KubernetesSeedProvider implements SeedProvider {
|
|||
|
||||
public List<InetAddress> getSeeds() {
|
||||
List<InetAddress> list = new ArrayList<InetAddress>();
|
||||
String host = "https://kubernetes.default.svc.cluster.local";
|
||||
String host = getEnvOrDefault("KUBERNETES_API_HOST","https://kubernetes.default.svc.cluster.local");
|
||||
String serviceName = getEnvOrDefault("CASSANDRA_SERVICE", "cassandra");
|
||||
String podNamespace = getEnvOrDefault("POD_NAMESPACE", "default");
|
||||
String path = String.format("/api/v1/namespaces/%s/endpoints/", podNamespace);
|
||||
|
|
Loading…
Reference in New Issue