Skip to content

Commit

Permalink
Adds probes, but for Kafka I don't think it indicates readiness...
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
solsson committed Jun 27, 2017
1 parent 411192d commit 2c4b6cd
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions 50kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ spec:
requests:
cpu: 100m
memory: 512Mi
livenessProbe:
exec:
command:
- /bin/sh
- -c
- 'echo "" | nc -w 1 127.0.0.1 9092'
volumeMounts:
- name: data
mountPath: /var/lib/kafka/data
Expand Down
12 changes: 12 additions & 0 deletions zookeeper/50pzoo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions zookeeper/51zoo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

1 comment on commit 2c4b6cd

@solsson
Copy link
Contributor Author

@solsson solsson commented on 2c4b6cd Aug 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've partially reverted this in 1f4321e because it lead to restarts, making tweaks to memory limits in #49 difficult

Please sign in to comment.