admin管理员组文章数量:1291264
I'm deploying Apache Ignite cluster in Kubernetes and using a startupProbe to ensure each node has joined the Ignite baseline topology. It's necessary to make sure that Server Node is completly ready for work (it's connected to Topology, caches are loaded..). For this I created custom bash script that utilizes Ignite REST Api to check whether the Node is part of Topology or not.
#!/bin/bash
apk add --no-cache curl jq
NODE_HOSTNAME=$(hostname)
echo "Hostname: $NODE_HOSTNAME"
NODE_ID=$(curl -s "http://localhost:8080/ignite?cmd=top" | \
jq -r --arg node_hostname "$NODE_HOSTNAME" '.response[] | select(.tcpHostNames[] | startswith($node_hostname)) | .consistentId')
echo "NODE_ID: $NODE_ID"
BASELINE=$(curl -s "http://localhost:8080/ignite?cmd=baseline" | \
jq -r --arg node_id "$NODE_ID" '.response.baseline[] | select(. == $node_id)')
echo "Baseline result: $BASELINE"
if [ -z "$BASELINE" ]; then
echo "Node is NOT part of the baseline topology yet."
exit 1
else
echo "Node is part of the baseline topology."
exit 0
fi
And my Kubernetes deployment's startupProbe is defined as:
startupProbe:
exec:
command:
- /bin/sh
- -c
- /scripts/check_baseline.sh
initialDelaySeconds: 10
periodSeconds: 10
failureThreshold: 60
I tested in containers and it works as expected, but when I tried to apply it as startupProbe, I faced the problem, that Readiness Probe is not started until StartUp succeeds, therefore the incoming traffic can not reach the Pod and Ignite Client can not join and form Topology. So I have a deadlock: StartupProbe waits for Node to join cluster, but it can not do it, since incoming traffic is blocked due to this probe.
Is there any way to workaround it? or may be other way how to add such a health check.
本文标签:
版权声明:本文标题:ignite - How can I configure a Kubernetes startupProbe without blocking inbound traffic needed for cluster formation? - Stack Ov 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741505984a2382322.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论