Skip to content

Commit 2c4b6cd

Browse files
committed
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 helm/charts#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.
1 parent 411192d commit 2c4b6cd

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

50kafka.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ spec:
4747
requests:
4848
cpu: 100m
4949
memory: 512Mi
50+
livenessProbe:
51+
exec:
52+
command:
53+
- /bin/sh
54+
- -c
55+
- 'echo "" | nc -w 1 127.0.0.1 9092'
5056
volumeMounts:
5157
- name: data
5258
mountPath: /var/lib/kafka/data

zookeeper/50pzoo.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ spec:
6060
requests:
6161
cpu: 10m
6262
memory: 100Mi
63+
livenessProbe:
64+
exec:
65+
command:
66+
- /bin/sh
67+
- -c
68+
- '[ "imok" == $(echo "ruok" | nc -w 1 127.0.0.1 2181) ]'
69+
readinessProbe:
70+
exec:
71+
command:
72+
- /bin/sh
73+
- -c
74+
- '[ "imok" == $(echo "ruok" | nc -w 1 127.0.0.1 2181) ]'
6375
volumeMounts:
6476
- name: config
6577
mountPath: /usr/local/kafka/config

zookeeper/51zoo.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ spec:
6060
requests:
6161
cpu: 10m
6262
memory: 100Mi
63+
livenessProbe:
64+
exec:
65+
command:
66+
- /bin/sh
67+
- -c
68+
- '[ "imok" == $(echo "ruok" | nc -w 1 127.0.0.1 2181) ]'
69+
readinessProbe:
70+
exec:
71+
command:
72+
- /bin/sh
73+
- -c
74+
- '[ "imok" == $(echo "ruok" | nc -w 1 127.0.0.1 2181) ]'
6375
volumeMounts:
6476
- name: config
6577
mountPath: /usr/local/kafka/config

0 commit comments

Comments
 (0)