Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
6a3d383b
Commit
6a3d383b
authored
Oct 05, 2015
by
Brendan Burns
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15041 from kevensen/cassandra-example
Cassandra Example
parents
c1012d8c
3a4d2d61
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
kubernetes-cassandra.jar
examples/cassandra/image/kubernetes-cassandra.jar
+0
-0
pom.xml
examples/cassandra/java/pom.xml
+1
-1
KubernetesSeedProvider.java
...dra/java/src/io/k8s/cassandra/KubernetesSeedProvider.java
+5
-2
No files found.
examples/cassandra/image/kubernetes-cassandra.jar
View file @
6a3d383b
No preview for this file type
examples/cassandra/java/pom.xml
View file @
6a3d383b
...
...
@@ -2,7 +2,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
io.k8s.cassandra
</groupId>
<artifactId>
kubernetes-cassandra
</artifactId>
<version>
0.0.
4
</version>
<version>
0.0.
5
</version>
<build>
<sourceDirectory>
src
</sourceDirectory>
<plugins>
...
...
examples/cassandra/java/src/io/k8s/cassandra/KubernetesSeedProvider.java
View file @
6a3d383b
...
...
@@ -100,7 +100,10 @@ public class KubernetesSeedProvider implements SeedProvider {
public
List
<
InetAddress
>
getSeeds
()
{
List
<
InetAddress
>
list
=
new
ArrayList
<
InetAddress
>();
String
host
=
getEnvOrDefault
(
"KUBERNETES_API_HOST"
,
"https://kubernetes.default.svc.cluster.local"
);
//String host = "https://kubernetes.default.svc.cluster.local";
String
proto
=
"https://"
;
String
host
=
getEnvOrDefault
(
"KUBERNETES_PORT_443_TCP_ADDR"
,
"kubernetes.default.svc.cluster.local"
);
String
port
=
getEnvOrDefault
(
"KUBERNETES_PORT_443_TCP_PORT"
,
"443"
);
String
serviceName
=
getEnvOrDefault
(
"CASSANDRA_SERVICE"
,
"cassandra"
);
String
podNamespace
=
getEnvOrDefault
(
"POD_NAMESPACE"
,
"default"
);
String
path
=
String
.
format
(
"/api/v1/namespaces/%s/endpoints/"
,
podNamespace
);
...
...
@@ -110,7 +113,7 @@ public class KubernetesSeedProvider implements SeedProvider {
SSLContext
ctx
=
SSLContext
.
getInstance
(
"SSL"
);
ctx
.
init
(
null
,
trustAll
,
new
SecureRandom
());
URL
url
=
new
URL
(
hos
t
+
path
+
serviceName
);
URL
url
=
new
URL
(
proto
+
host
+
":"
+
por
t
+
path
+
serviceName
);
logger
.
info
(
"Getting endpoints from "
+
url
);
HttpsURLConnection
conn
=
(
HttpsURLConnection
)
url
.
openConnection
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment