Skip to content

Commit 01e7059

Browse files
committed
fix(unbound): use project's healthcheck pattern
1 parent fe37541 commit 01e7059

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

deploy/kustomize/unbound/deployment.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ spec:
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

target/unbound/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ COPY --chown=unbound:unbound rootfs/ /
1010
USER unbound
1111

1212
EXPOSE 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
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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

0 commit comments

Comments
 (0)