blob: 23c0c786b4c3315dbd88fdf8d0bb337129794a74 (
plain) (
tree)
|
|
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
- -Xms39M
- -Xmx99M
- -jar
- jmx_prometheus_httpserver.jar
- "5556"
- example_configs/zookeeper.yaml
ports:
- containerPort: 5556
resources:
requests:
cpu: 0m
memory: 40Mi
limits:
cpu: 10m
memory: 100Mi
- name: zookeeper
image: solsson/kafka:0.11.0.0@sha256:92c5092d7c2f10abd11693731f6e112d40bfd42d6428a7cdf0516c9666dd3e58
env:
- name: JMX_PORT
value: "5555"
command:
- /bin/bash
- -euc
- >
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
resources:
requests:
cpu: 10m
memory: 100Mi
livenessProbe:
exec:
command:
- /bin/sh
- -c
- '[ "imok" = "$(echo ruok | nc -w 1 127.0.0.1 2181)" ]'
readinessProbe:
exec:
command:
- /bin/sh
- -c
- '[ "imok" = "$(echo ruok | nc -w 1 127.0.0.1 2181)" ]'
volumeMounts:
- name: config
mountPath: /opt/kafka/config
- name: data
mountPath: /var/lib/zookeeper/data
volumes:
- name: config
configMap:
name: zookeeper-config
- name: data
emptyDir: {}
|