diff options
author | solsson <solsson@gmail.com> | 2017-06-26 13:22:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-26 13:22:47 +0200 |
commit | 4a16d4fc8ccbf7b56f0de3dfeab1b01e452665c4 (patch) | |
tree | 823503eefcdb28c4bd82d019f328b2ebb9b591f6 /zookeeper/51zoo.yml | |
parent | 26173af8577d3c11904196a04ca0b158f339bd64 (diff) | |
parent | cb83353833645e543153cf6f9756ef3858f80442 (diff) | |
download | kubernetes-kafka-4a16d4fc8ccbf7b56f0de3dfeab1b01e452665c4.tar.gz kubernetes-kafka-4a16d4fc8ccbf7b56f0de3dfeab1b01e452665c4.tar.bz2 kubernetes-kafka-4a16d4fc8ccbf7b56f0de3dfeab1b01e452665c4.zip |
Merge pull request #34 from Yolean/zookeeper-availability-zones
Suggest a mix of persistent and ephemeral data to improve reliability across zones
Diffstat (limited to 'zookeeper/51zoo.yml')
-rw-r--r-- | zookeeper/51zoo.yml | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/zookeeper/51zoo.yml b/zookeeper/51zoo.yml new file mode 100644 index 0000000..f041a9a --- /dev/null +++ b/zookeeper/51zoo.yml @@ -0,0 +1,62 @@ +apiVersion: apps/v1beta1 +kind: StatefulSet +metadata: + name: zoo + namespace: kafka +spec: + serviceName: "zoo" + replicas: 2 + template: + metadata: + labels: + app: zookeeper + storage: ephemeral + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "5556" + spec: + terminationGracePeriodSeconds: 10 + containers: + - name: metrics + image: solsson/kafka-prometheus-jmx-exporter@sha256:1f7c96c287a2dbec1d909cd8f96c0656310239b55a9a90d7fd12c81f384f1f7d + command: + - "java" + - "-jar" + - "jmx_prometheus_httpserver.jar" + - "5556" + - example_configs/zookeeper.yaml + ports: + - containerPort: 5556 + - name: zookeeper + image: solsson/kafka:0.11.0.0-rc2@sha256:c1316e0131f4ec83bc645ca2141e4fda94e0d28f4fb5f836e15e37a5e054bdf1 + env: + - name: JMX_PORT + value: "5555" + command: + - sh + - -c + - > + set -e; + export ZOOKEEPER_SERVER_ID=$((${HOSTNAME##*-} + 4)); + echo "${ZOOKEEPER_SERVER_ID:-1}" | tee /var/lib/zookeeper/data/myid; + sed -i "s/server\.$ZOOKEEPER_SERVER_ID\=[a-z0-9.-]*/server.$ZOOKEEPER_SERVER_ID=0.0.0.0/" config/zookeeper.properties; + cat config/zookeeper.properties; + ./bin/zookeeper-server-start.sh config/zookeeper.properties + ports: + - containerPort: 2181 + name: client + - containerPort: 2888 + name: peer + - containerPort: 3888 + name: leader-election + volumeMounts: + - name: config + mountPath: /usr/local/kafka/config + - name: data + mountPath: /var/lib/zookeeper/data + volumes: + - name: config + configMap: + name: zookeeper-config + - name: data + emptyDir: {} |