mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 12:32:03 +00:00
More updates to docker, including more env overrides. For example you can now set cluster name.
someone tell me if this is wrong, but I do not think "examples/cassandra/image/run.sh: cluster_name \" should have been found
This commit is contained in:
parent
aca07ebb6a
commit
98cafe64ac
@ -80,7 +80,14 @@ computer.
|
|||||||
The pods use the [```gcr.io/google-samples/cassandra:v9```](image/Dockerfile)
|
The pods use the [```gcr.io/google-samples/cassandra:v9```](image/Dockerfile)
|
||||||
image from Google's [container registry](https://cloud.google.com/container-registry/docs/).
|
image from Google's [container registry](https://cloud.google.com/container-registry/docs/).
|
||||||
The docker is based on `debian:jessie` and includes OpenJDK 8. This image
|
The docker is based on `debian:jessie` and includes OpenJDK 8. This image
|
||||||
includes a standard Cassandra installation from the Apache Debian repo.
|
includes a standard Cassandra installation from the Apache Debian repo. Through the use
|
||||||
|
of environment variables you are able to change values that are inserted into the `cassandra.yaml`.
|
||||||
|
|
||||||
|
| ENV VAR | DEFAULT VALUE |
|
||||||
|
| ------------- |:-------------: |
|
||||||
|
| CASSANDRA_CLUSTER_NAME | 'Test Cluster' |
|
||||||
|
| CASSANDRA_NUM_TOKENS | 32 |
|
||||||
|
| CASSANDRA_RPC_ADDRESS | 0.0.0.0 |
|
||||||
|
|
||||||
### Custom Seed Provider
|
### Custom Seed Provider
|
||||||
|
|
||||||
@ -229,7 +236,7 @@ spec:
|
|||||||
- /run.sh
|
- /run.sh
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: .5
|
cpu: 0.5
|
||||||
env:
|
env:
|
||||||
- name: MAX_HEAP_SIZE
|
- name: MAX_HEAP_SIZE
|
||||||
value: 512M
|
value: 512M
|
||||||
@ -239,13 +246,24 @@ spec:
|
|||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: metadata.namespace
|
fieldPath: metadata.namespace
|
||||||
|
- name: POD_IP
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: status.podIP
|
||||||
image: gcr.io/google-samples/cassandra:v9
|
image: gcr.io/google-samples/cassandra:v9
|
||||||
name: cassandra
|
name: cassandra
|
||||||
ports:
|
ports:
|
||||||
|
- containerPort: 7000
|
||||||
|
name: intra-node
|
||||||
|
- containerPort: 7001
|
||||||
|
name: tls-intra-node
|
||||||
|
- containerPort: 7199
|
||||||
|
name: jmx
|
||||||
- containerPort: 9042
|
- containerPort: 9042
|
||||||
name: cql
|
name: cql
|
||||||
- containerPort: 9160
|
# If you need it it is going away in C* 4.0
|
||||||
name: thrift
|
#- containerPort: 9160
|
||||||
|
# name: thrift
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /cassandra_data
|
- mountPath: /cassandra_data
|
||||||
name: data
|
name: data
|
||||||
@ -457,16 +475,27 @@ spec:
|
|||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: metadata.namespace
|
fieldPath: metadata.namespace
|
||||||
|
- name: POD_IP
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: status.podIP
|
||||||
image: gcr.io/google-samples/cassandra:v9
|
image: gcr.io/google-samples/cassandra:v9
|
||||||
name: cassandra
|
name: cassandra
|
||||||
ports:
|
ports:
|
||||||
|
- containerPort: 7000
|
||||||
|
name: intra-node
|
||||||
|
- containerPort: 7001
|
||||||
|
name: tls-intra-node
|
||||||
|
- containerPort: 7199
|
||||||
|
name: jmx
|
||||||
- containerPort: 9042
|
- containerPort: 9042
|
||||||
name: cql
|
name: cql
|
||||||
- containerPort: 9160
|
# If you need it it is going away in C* 4.0
|
||||||
name: thrift
|
#- containerPort: 9160
|
||||||
|
# name: thrift
|
||||||
resources:
|
resources:
|
||||||
request:
|
request:
|
||||||
cpu: .5
|
cpu: 0.5
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /cassandra_data
|
- mountPath: /cassandra_data
|
||||||
name: data
|
name: data
|
||||||
|
@ -22,7 +22,7 @@ spec:
|
|||||||
- /run.sh
|
- /run.sh
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: .5
|
cpu: 0.5
|
||||||
env:
|
env:
|
||||||
- name: MAX_HEAP_SIZE
|
- name: MAX_HEAP_SIZE
|
||||||
value: 512M
|
value: 512M
|
||||||
@ -32,13 +32,24 @@ spec:
|
|||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: metadata.namespace
|
fieldPath: metadata.namespace
|
||||||
|
- name: POD_IP
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: status.podIP
|
||||||
image: gcr.io/google-samples/cassandra:v9
|
image: gcr.io/google-samples/cassandra:v9
|
||||||
name: cassandra
|
name: cassandra
|
||||||
ports:
|
ports:
|
||||||
|
- containerPort: 7000
|
||||||
|
name: intra-node
|
||||||
|
- containerPort: 7001
|
||||||
|
name: tls-intra-node
|
||||||
|
- containerPort: 7199
|
||||||
|
name: jmx
|
||||||
- containerPort: 9042
|
- containerPort: 9042
|
||||||
name: cql
|
name: cql
|
||||||
- containerPort: 9160
|
# If you need it it is going away in C* 4.0
|
||||||
name: thrift
|
#- containerPort: 9160
|
||||||
|
# name: thrift
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /cassandra_data
|
- mountPath: /cassandra_data
|
||||||
name: data
|
name: data
|
||||||
|
@ -25,16 +25,27 @@ spec:
|
|||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: metadata.namespace
|
fieldPath: metadata.namespace
|
||||||
|
- name: POD_IP
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: status.podIP
|
||||||
image: gcr.io/google-samples/cassandra:v9
|
image: gcr.io/google-samples/cassandra:v9
|
||||||
name: cassandra
|
name: cassandra
|
||||||
ports:
|
ports:
|
||||||
|
- containerPort: 7000
|
||||||
|
name: intra-node
|
||||||
|
- containerPort: 7001
|
||||||
|
name: tls-intra-node
|
||||||
|
- containerPort: 7199
|
||||||
|
name: jmx
|
||||||
- containerPort: 9042
|
- containerPort: 9042
|
||||||
name: cql
|
name: cql
|
||||||
- containerPort: 9160
|
# If you need it it is going away in C* 4.0
|
||||||
name: thrift
|
#- containerPort: 9160
|
||||||
|
# name: thrift
|
||||||
resources:
|
resources:
|
||||||
request:
|
request:
|
||||||
cpu: .5
|
cpu: 0.5
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /cassandra_data
|
- mountPath: /cassandra_data
|
||||||
name: data
|
name: data
|
||||||
|
@ -41,6 +41,13 @@ COPY kubernetes-cassandra.jar /kubernetes-cassandra.jar
|
|||||||
|
|
||||||
VOLUME ["/cassandra_data/data"]
|
VOLUME ["/cassandra_data/data"]
|
||||||
|
|
||||||
|
# 7000: intra-node communication
|
||||||
|
# 7001: TLS intra-node communication
|
||||||
|
# 7199: JMX
|
||||||
|
# 9042: CQL
|
||||||
|
# 9160: thrift service not included cause it is going away
|
||||||
|
EXPOSE 7000 7001 7199 9042
|
||||||
|
|
||||||
USER cassandra
|
USER cassandra
|
||||||
|
|
||||||
CMD /run.sh
|
CMD /run.sh
|
||||||
|
@ -22,7 +22,7 @@ cluster_name: 'Test Cluster'
|
|||||||
#
|
#
|
||||||
# If you already have a cluster with 1 token per node, and wish to migrate to
|
# If you already have a cluster with 1 token per node, and wish to migrate to
|
||||||
# multiple tokens per node, see http://wiki.apache.org/cassandra/Operations
|
# multiple tokens per node, see http://wiki.apache.org/cassandra/Operations
|
||||||
num_tokens: 256
|
num_tokens: 32
|
||||||
|
|
||||||
# initial_token allows you to specify tokens manually. While you can use # it with
|
# initial_token allows you to specify tokens manually. While you can use # it with
|
||||||
# vnodes (num_tokens > 1, above) -- in which case you should provide a
|
# vnodes (num_tokens > 1, above) -- in which case you should provide a
|
||||||
@ -258,7 +258,7 @@ seed_provider:
|
|||||||
parameters:
|
parameters:
|
||||||
# seeds is actually a comma-delimited list of addresses.
|
# seeds is actually a comma-delimited list of addresses.
|
||||||
# Ex: "<ip1>,<ip2>,<ip3>"
|
# Ex: "<ip1>,<ip2>,<ip3>"
|
||||||
- seeds: "%%ip%%"
|
- seeds: 127.0.0.1
|
||||||
|
|
||||||
# For workloads with more data than can fit in memory, Cassandra's
|
# For workloads with more data than can fit in memory, Cassandra's
|
||||||
# bottleneck will be reads that need to fetch data from
|
# bottleneck will be reads that need to fetch data from
|
||||||
@ -364,7 +364,7 @@ ssl_storage_port: 7001
|
|||||||
# address associated with the hostname (it might not be).
|
# address associated with the hostname (it might not be).
|
||||||
#
|
#
|
||||||
# Setting listen_address to 0.0.0.0 is always wrong.
|
# Setting listen_address to 0.0.0.0 is always wrong.
|
||||||
listen_address: %%ip%%
|
listen_address: 127.0.0.1
|
||||||
# listen_interface: eth0
|
# listen_interface: eth0
|
||||||
|
|
||||||
# Address to broadcast to other Cassandra nodes
|
# Address to broadcast to other Cassandra nodes
|
||||||
@ -405,7 +405,7 @@ start_rpc: true
|
|||||||
#
|
#
|
||||||
# Note that unlike listen_address, you can specify 0.0.0.0, but you must also
|
# Note that unlike listen_address, you can specify 0.0.0.0, but you must also
|
||||||
# set broadcast_rpc_address to a value other than 0.0.0.0.
|
# set broadcast_rpc_address to a value other than 0.0.0.0.
|
||||||
rpc_address: %%ip%%
|
rpc_address: 127.0.0.1
|
||||||
# rpc_interface: eth1
|
# rpc_interface: eth1
|
||||||
|
|
||||||
# port for Thrift to listen for clients on
|
# port for Thrift to listen for clients on
|
||||||
|
@ -14,6 +14,54 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
perl -pi -e "s/%%ip%%/$(hostname -I)/g" /etc/cassandra/cassandra.yaml
|
set -e
|
||||||
|
CFG=/etc/cassandra/cassandra.yaml
|
||||||
|
CASSANDRA_RPC_ADDRESS="${CASSANDRA_RPC_ADDRESS:-0.0.0.0}"
|
||||||
|
CASSANDRA_NUM_TOKENS="${CASSANDRA_NUM_TOKENS:-32}"
|
||||||
|
CASSANDRA_CLUSTER_NAME="${CASSANDRA_CLUSTER_NAME:=Test Cluster}"
|
||||||
|
CASSANDRA_LISTEN_ADDRESS=${POD_IP}
|
||||||
|
CASSANDRA_BROADCAST_ADDRESS=${POD_IP}
|
||||||
|
CASSANDRA_BROADCAST_RPC_ADDRESS=${POD_IP}
|
||||||
|
|
||||||
|
# TODO what else needs to be modified
|
||||||
|
|
||||||
|
for yaml in \
|
||||||
|
broadcast_address \
|
||||||
|
broadcast_rpc_address \
|
||||||
|
cluster_name \
|
||||||
|
listen_address \
|
||||||
|
num_tokens \
|
||||||
|
rpc_address \
|
||||||
|
; do
|
||||||
|
var="CASSANDRA_${yaml^^}"
|
||||||
|
val="${!var}"
|
||||||
|
if [ "$val" ]; then
|
||||||
|
sed -ri 's/^(# )?('"$yaml"':).*/\2 '"$val"'/' "$CFG"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Eventual do snitch $DC && $RACK?
|
||||||
|
#if [[ $SNITCH ]]; then
|
||||||
|
# sed -i -e "s/endpoint_snitch: SimpleSnitch/endpoint_snitch: $SNITCH/" $CONFIG/cassandra.yaml
|
||||||
|
#fi
|
||||||
|
#if [[ $DC && $RACK ]]; then
|
||||||
|
# echo "dc=$DC" > $CONFIG/cassandra-rackdc.properties
|
||||||
|
# echo "rack=$RACK" >> $CONFIG/cassandra-rackdc.properties
|
||||||
|
#fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# see if this is needed
|
||||||
|
#echo "JVM_OPTS=\"\$JVM_OPTS -Djava.rmi.server.hostname=$IP\"" >> $CASSANDRA_CONFIG/cassandra-env.sh
|
||||||
|
#
|
||||||
|
|
||||||
|
# FIXME create README for these args
|
||||||
|
echo "Starting Cassandra on $POD_IP"
|
||||||
|
echo CASSANDRA_RPC_ADDRESS ${CASSANDRA_RPC_ADDRESS}
|
||||||
|
echo CASSANDRA_NUM_TOKENS ${CASSANDRA_NUM_TOKENS}
|
||||||
|
echo CASSANDRA_CLUSTER_NAME ${CASSANDRA_CLUSTER_NAME}
|
||||||
|
echo CASSANDRA_LISTEN_ADDRESS ${POD_IP}
|
||||||
|
echo CASSANDRA_BROADCAST_ADDRESS ${POD_IP}
|
||||||
|
echo CASSANDRA_BROADCAST_RPC_ADDRESS ${POD_IP}
|
||||||
|
|
||||||
export CLASSPATH=/kubernetes-cassandra.jar
|
export CLASSPATH=/kubernetes-cassandra.jar
|
||||||
cassandra -f
|
cassandra -f
|
||||||
|
@ -62,6 +62,7 @@ docs/getting-started-guides/coreos/azure/lib/deployment_logic/kubernetes.js: re
|
|||||||
docs/getting-started-guides/coreos/azure/lib/deployment_logic/kubernetes.js: return cloud_config.process_template(input_file, output_file, function(data) {
|
docs/getting-started-guides/coreos/azure/lib/deployment_logic/kubernetes.js: return cloud_config.process_template(input_file, output_file, function(data) {
|
||||||
docs/getting-started-guides/coreos/azure/lib/deployment_logic/kubernetes.js: var write_files_extra = cloud_config.write_files_from('addons', '/etc/kubernetes/addons');
|
docs/getting-started-guides/coreos/azure/lib/deployment_logic/kubernetes.js: var write_files_extra = cloud_config.write_files_from('addons', '/etc/kubernetes/addons');
|
||||||
docs/getting-started-guides/coreos/azure/lib/deployment_logic/kubernetes.js:var cloud_config = require('../cloud_config.js');
|
docs/getting-started-guides/coreos/azure/lib/deployment_logic/kubernetes.js:var cloud_config = require('../cloud_config.js');
|
||||||
|
examples/cassandra/image/run.sh: cluster_name \
|
||||||
examples/cluster-dns/images/frontend/client.py: service_address = socket.gethostbyname(hostname)
|
examples/cluster-dns/images/frontend/client.py: service_address = socket.gethostbyname(hostname)
|
||||||
examples/vitess/env.sh: node_ip=$(get_node_ip)
|
examples/vitess/env.sh: node_ip=$(get_node_ip)
|
||||||
hack/local-up-cluster.sh: runtime_config="--runtime-config=${RUNTIME_CONFIG}"
|
hack/local-up-cluster.sh: runtime_config="--runtime-config=${RUNTIME_CONFIG}"
|
||||||
@ -86,6 +87,7 @@ test/e2e/es_cluster_logging.go: clusterName, ok := esResponse["cluster_name"]
|
|||||||
test/e2e/host_path.go: fmt.Sprintf("--file_content_in_loop=%v", filePath),
|
test/e2e/host_path.go: fmt.Sprintf("--file_content_in_loop=%v", filePath),
|
||||||
test/e2e/host_path.go: fmt.Sprintf("--file_content_in_loop=%v", filePathInReader),
|
test/e2e/host_path.go: fmt.Sprintf("--file_content_in_loop=%v", filePathInReader),
|
||||||
test/e2e/host_path.go: fmt.Sprintf("--retry_time=%d", retryDuration),
|
test/e2e/host_path.go: fmt.Sprintf("--retry_time=%d", retryDuration),
|
||||||
|
test/e2e/host_path.go: fmt.Sprintf("--retry_time=%d", retryDuration),
|
||||||
test/images/mount-tester/mt.go: flag.BoolVar(&breakOnExpectedContent, "break_on_expected_content", true, "Break out of loop on expected content, (use with --file_content_in_loop flag only)")
|
test/images/mount-tester/mt.go: flag.BoolVar(&breakOnExpectedContent, "break_on_expected_content", true, "Break out of loop on expected content, (use with --file_content_in_loop flag only)")
|
||||||
test/images/mount-tester/mt.go: flag.IntVar(&retryDuration, "retry_time", 180, "Retry time during the loop")
|
test/images/mount-tester/mt.go: flag.IntVar(&retryDuration, "retry_time", 180, "Retry time during the loop")
|
||||||
test/images/mount-tester/mt.go: flag.StringVar(&readFileContentInLoopPath, "file_content_in_loop", "", "Path to read the file content in loop from")
|
test/images/mount-tester/mt.go: flag.StringVar(&readFileContentInLoopPath, "file_content_in_loop", "", "Path to read the file content in loop from")
|
||||||
|
Loading…
Reference in New Issue
Block a user