File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 4646 containerPort : 5353
4747 protocol : TCP
4848 livenessProbe :
49- tcpSocket :
50- port : dns-tcp
49+ exec :
50+ command :
51+ - /usr/local/bin/healthcheck.sh
5152 initialDelaySeconds : 30
5253 periodSeconds : 30
5354 timeoutSeconds : 10
Original file line number Diff line number Diff line change @@ -10,4 +10,4 @@ COPY --chown=unbound:unbound rootfs/ /
1010USER unbound
1111
1212EXPOSE 5353/tcp 5353/udp
13- HEALTHCHECK CMD dig @127.0.0.1 -p 5353 github.com || exit 1
13+ HEALTHCHECK CMD /usr/local/bin/healthcheck.sh
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ set -e
3+
4+ # Test DNS resolution using dig
5+ if ! dig @127.0.0.1 -p 5353 github.com > /dev/null 2>&1 ; then
6+ echo " Healthcheck failed: DNS resolution test failed"
7+ exit 1
8+ fi
9+
10+ # Test UDP connectivity (unbound typically uses UDP for DNS)
11+ if ! dig @127.0.0.1 -p 5353 +tcp github.com > /dev/null 2>&1 ; then
12+ echo " Healthcheck failed: TCP DNS resolution test failed"
13+ exit 1
14+ fi
15+
16+ echo " Healthcheck passed"
17+
18+ exit 0
You can’t perform that action at this time.
0 commit comments