diff options
author | Staffan Olsson <staffan@repos.se> | 2017-06-27 13:08:54 +0200 |
---|---|---|
committer | Staffan Olsson <staffan@repos.se> | 2017-06-27 13:15:05 +0200 |
commit | 2c4b6cd96dd45d52065431ad97a034d0444100a7 (patch) | |
tree | 2776c3b2ccb937bba5156669739ccc3b7dcd6ebc /zookeeper | |
parent | 411192d3d6bc06984d93556fa5867225203d8aed (diff) | |
download | kubernetes-kafka-2c4b6cd96dd45d52065431ad97a034d0444100a7.tar.gz kubernetes-kafka-2c4b6cd96dd45d52065431ad97a034d0444100a7.tar.bz2 kubernetes-kafka-2c4b6cd96dd45d52065431ad97a034d0444100a7.zip |
Adds probes, but for Kafka I don't think it indicates readiness...
which might not matter because we no longer have a loadbalancing service.
These probes won't catch all failure modes,
but if they fail we're pretty sure the container is malfunctioning.
I found some sources recommending ./bin/kafka-topics.sh for probes
but to me it looks risky to introduce a dependency to some other service for such things.
One such source is https://github.com/kubernetes/charts/pull/144
The zookeeper probe is from
https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
An issue is that zookeeper's logs are quite verbose for every probe.
Diffstat (limited to 'zookeeper')
-rw-r--r-- | zookeeper/50pzoo.yml | 12 | ||||
-rw-r--r-- | zookeeper/51zoo.yml | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/zookeeper/50pzoo.yml b/zookeeper/50pzoo.yml index 7b949ce..c8e3542 100644 --- a/zookeeper/50pzoo.yml +++ b/zookeeper/50pzoo.yml @@ -60,6 +60,18 @@ spec: 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: /usr/local/kafka/config diff --git a/zookeeper/51zoo.yml b/zookeeper/51zoo.yml index b73db29..50be93d 100644 --- a/zookeeper/51zoo.yml +++ b/zookeeper/51zoo.yml @@ -60,6 +60,18 @@ spec: 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: /usr/local/kafka/config |