Commit 8098504e authored by Brian Grant's avatar Brian Grant

Merge pull request #21645 from amygdala/cassandra

Cassandra example: daemonset volume fix, readme cleanup, update to new gcr image
parents bc96422e 04a58545
...@@ -28,7 +28,7 @@ spec: ...@@ -28,7 +28,7 @@ spec:
valueFrom: valueFrom:
fieldRef: fieldRef:
fieldPath: metadata.namespace fieldPath: metadata.namespace
image: gcr.io/google_containers/cassandra:v6 image: gcr.io/google-samples/cassandra:v8
name: cassandra name: cassandra
ports: ports:
- containerPort: 9042 - containerPort: 9042
......
...@@ -8,7 +8,7 @@ spec: ...@@ -8,7 +8,7 @@ spec:
template: template:
metadata: metadata:
labels: labels:
name: cassandra app: cassandra
spec: spec:
# Filter to specific nodes: # Filter to specific nodes:
# nodeSelector: # nodeSelector:
...@@ -25,7 +25,7 @@ spec: ...@@ -25,7 +25,7 @@ spec:
valueFrom: valueFrom:
fieldRef: fieldRef:
fieldPath: metadata.namespace fieldPath: metadata.namespace
image: "gcr.io/google_containers/cassandra:v6" image: gcr.io/google-samples/cassandra:v8
name: cassandra name: cassandra
ports: ports:
- containerPort: 9042 - containerPort: 9042
...@@ -40,5 +40,4 @@ spec: ...@@ -40,5 +40,4 @@ spec:
name: data name: data
volumes: volumes:
- name: data - name: data
hostPath: emptyDir: {}
path: /var/lib/cassandra
...@@ -11,7 +11,7 @@ spec: ...@@ -11,7 +11,7 @@ spec:
resources: resources:
limits: limits:
cpu: "0.1" cpu: "0.1"
image: gcr.io/google_containers/cassandra:v6 image: gcr.io/google-samples/cassandra:v8
name: cassandra name: cassandra
ports: ports:
- name: cql - name: cql
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# build the cassandra image. # build the cassandra image.
VERSION=v7 VERSION=v8
all: build all: build
...@@ -24,9 +24,9 @@ kubernetes-cassandra.jar: ../java/* ../java/src/io/k8s/cassandra/*.java ...@@ -24,9 +24,9 @@ kubernetes-cassandra.jar: ../java/* ../java/src/io/k8s/cassandra/*.java
cd ../java && mvn clean cd ../java && mvn clean
build: kubernetes-cassandra.jar build: kubernetes-cassandra.jar
docker build -t gcr.io/google_containers/cassandra:${VERSION} . docker build -t gcr.io/google_samples/cassandra:${VERSION} .
push: build push: build
gcloud docker push gcr.io/google_containers/cassandra:${VERSION} gcloud docker push gcr.io/google_samples/cassandra:${VERSION}
.PHONY: all build push .PHONY: all build push
/*
* Copyright (C) 2015 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package io.k8s.cassandra; package io.k8s.cassandra;
import java.io.IOException; import java.io.IOException;
...@@ -32,7 +48,7 @@ import org.slf4j.Logger; ...@@ -32,7 +48,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class KubernetesSeedProvider implements SeedProvider { public class KubernetesSeedProvider implements SeedProvider {
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
static class Address { static class Address {
public String ip; public String ip;
...@@ -40,14 +56,14 @@ public class KubernetesSeedProvider implements SeedProvider { ...@@ -40,14 +56,14 @@ public class KubernetesSeedProvider implements SeedProvider {
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
static class Subset { static class Subset {
public List<Address> addresses; public List<Address> addresses;
} }
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
static class Endpoints { static class Endpoints {
public List<Subset> subsets; public List<Subset> subsets;
} }
private static String getEnvOrDefault(String var, String def) { private static String getEnvOrDefault(String var, String def) {
String val = System.getenv(var); String val = System.getenv(var);
if (val == null) { if (val == null) {
...@@ -141,7 +157,7 @@ public class KubernetesSeedProvider implements SeedProvider { ...@@ -141,7 +157,7 @@ public class KubernetesSeedProvider implements SeedProvider {
logger.warn("Endpoints are not available"); logger.warn("Endpoints are not available");
} }
} catch (IOException | NoSuchAlgorithmException | KeyManagementException ex) { } catch (IOException | NoSuchAlgorithmException | KeyManagementException ex) {
logger.warn("Request to kubernetes apiserver failed", ex); logger.warn("Request to kubernetes apiserver failed", ex);
} }
if (list.size() == 0) { if (list.size() == 0) {
// If we got nothing, we might be the first instance, in that case // If we got nothing, we might be the first instance, in that case
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment