Skip to content

Commit

Permalink
chore: replace java by nc for zookeeper probe
Browse files Browse the repository at this point in the history
  • Loading branch information
kubeJocker committed Jan 10, 2025
1 parent 6034185 commit 4205543
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion addons/zookeeper/config/zookeeper-config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ maxClientCnxns=500
{{- end }}

# whitelist
4lw.commands.whitelist=srvr, mntr, ruok, conf
4lw.commands.whitelist=srvr, mntr, ruok, conf, stat

# cluster server list
{{- printf "\n" }}
Expand Down
20 changes: 14 additions & 6 deletions addons/zookeeper/templates/cmpd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,13 @@ spec:
- /bin/bash
- -c
- |
. "$ZOOBINDIR"/zkEnv.sh > /dev/null
java -cp "$CLASSPATH" $CLIENT_JVMFLAGS $JVMFLAGS org.apache.zookeeper.client.FourLetterWordMain \
localhost 2181 ruok | grep imok
if command -v nc &> /dev/null; then
echo "ruok" | timeout 2 nc localhost 2181 | grep imok;
else
. "$ZOOBINDIR"/zkEnv.sh > /dev/null
java -cp "$CLASSPATH" $CLIENT_JVMFLAGS $JVMFLAGS org.apache.zookeeper.client.FourLetterWordMain \
localhost 2181 ruok | grep imok
fi
readinessProbe:
failureThreshold: 6
initialDelaySeconds: 5
Expand All @@ -158,9 +162,13 @@ spec:
- bash
- -c
- |
. "$ZOOBINDIR"/zkEnv.sh > /dev/null
java -cp "$CLASSPATH" $CLIENT_JVMFLAGS $JVMFLAGS org.apache.zookeeper.client.FourLetterWordMain \
localhost 2181 ruok | grep imok
if command -v nc &> /dev/null; then
echo "ruok" | timeout 2 nc localhost 2181 | grep imok;
else
. "$ZOOBINDIR"/zkEnv.sh > /dev/null
java -cp "$CLASSPATH" $CLIENT_JVMFLAGS $JVMFLAGS org.apache.zookeeper.client.FourLetterWordMain \
localhost 2181 ruok | grep imok
fi
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down

0 comments on commit 4205543

Please sign in to comment.