Commit 04a58545 authored by Amy Unruh's avatar Amy Unruh

Cassandra example: daemonset volume fix, readme cleanup, update to new gcr

image consistent with the code base. Change the label on the daemonset to 'app'.
parent 7191e6a4
......@@ -28,7 +28,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: gcr.io/google_containers/cassandra:v6
image: gcr.io/google-samples/cassandra:v8
name: cassandra
ports:
- containerPort: 9042
......
......@@ -8,7 +8,7 @@ spec:
template:
metadata:
labels:
name: cassandra
app: cassandra
spec:
# Filter to specific nodes:
# nodeSelector:
......@@ -25,7 +25,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: "gcr.io/google_containers/cassandra:v6"
image: gcr.io/google-samples/cassandra:v8
name: cassandra
ports:
- containerPort: 9042
......@@ -40,5 +40,4 @@ spec:
name: data
volumes:
- name: data
hostPath:
path: /var/lib/cassandra
emptyDir: {}
......@@ -11,7 +11,7 @@ spec:
resources:
limits:
cpu: "0.1"
image: gcr.io/google_containers/cassandra:v6
image: gcr.io/google-samples/cassandra:v8
name: cassandra
ports:
- name: cql
......
......@@ -14,7 +14,7 @@
# build the cassandra image.
VERSION=v7
VERSION=v8
all: build
......@@ -24,9 +24,9 @@ kubernetes-cassandra.jar: ../java/* ../java/src/io/k8s/cassandra/*.java
cd ../java && mvn clean
build: kubernetes-cassandra.jar
docker build -t gcr.io/google_containers/cassandra:${VERSION} .
docker build -t gcr.io/google_samples/cassandra:${VERSION} .
push: build
gcloud docker push gcr.io/google_containers/cassandra:${VERSION}
gcloud docker push gcr.io/google_samples/cassandra:${VERSION}
.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;
import java.io.IOException;
......@@ -32,7 +48,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class KubernetesSeedProvider implements SeedProvider {
@JsonIgnoreProperties(ignoreUnknown = true)
static class Address {
public String ip;
......@@ -40,14 +56,14 @@ public class KubernetesSeedProvider implements SeedProvider {
@JsonIgnoreProperties(ignoreUnknown = true)
static class Subset {
public List<Address> addresses;
public List<Address> addresses;
}
@JsonIgnoreProperties(ignoreUnknown = true)
static class Endpoints {
public List<Subset> subsets;
}
private static String getEnvOrDefault(String var, String def) {
String val = System.getenv(var);
if (val == null) {
......@@ -141,7 +157,7 @@ public class KubernetesSeedProvider implements SeedProvider {
logger.warn("Endpoints are not available");
}
} 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 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