Skip to content

Commit f936822

Browse files
cursoragentjeboehm
andcommitted
Refactor: Change unbound port to 53 and update healthcheck
Co-authored-by: j.boehm <[email protected]>
1 parent a8c17e8 commit f936822

File tree

4 files changed

+28
-9
lines changed

4 files changed

+28
-9
lines changed

deploy/kustomize/unbound/network-policy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ spec:
2020
- podSelector: {}
2121
ports:
2222
- protocol: UDP
23-
port: 5353 # DNS
23+
port: 53 # DNS
2424
- protocol: TCP
25-
port: 5353 # DNS TCP
25+
port: 53 # DNS TCP

docs/UPGRADE.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ The Helm chart has been deprecated and archived.
2121
- **Mail Submission**: Mail submission is now only possible on port 587.
2222

2323
### MDA (Mail Delivery Agent)
24-
- **Unbound port change and capability requirement (breaking)**: Unbound now listens on port `53` (UDP/TCP) instead of `5353`.
25-
- Compose: the `unbound` service now requires `cap_add: [NET_BIND_SERVICE]` to bind <1024 as non-root.
26-
- Kubernetes: the `unbound` deployment exposes containerPorts `53/TCP` and `53/UDP` and adds the `NET_BIND_SERVICE` capability.
27-
- Rspamd and internal components should use `unbound:53`. Any hardcoded `:5353` must be updated.
28-
- If you previously customized Postfix to use `127.0.0.1:5353`, remove that customization. Postfix and other services should resolve via standard port 53.
29-
3024
- **Base Image**: Changed to `dovecot/dovecot`. This image is no longer based on Alpine Linux.
3125
- **TLS Certificate Paths**: Updated to `/etc/dovecot/tls/tls.crt` and `/etc/dovecot/tls/tls.key`. A Diffie-Hellman file is no longer required.
3226
- **Mail Storage**: Now mounted to `/srv/vmail` instead of `/var/vmail`.
@@ -41,3 +35,11 @@ The Helm chart has been deprecated and archived.
4135

4236
- **Full Text Search**: Enabled by default. All `FTS_` environment variables have been removed.
4337
- **Protocol Support**: POP3 and IMAP are always enabled. The `POP3_ENABLED` and `IMAP_ENABLED` environment variables have been removed.
38+
39+
## v6.0 to v6.1
40+
41+
- **Unbound port change and capability requirement (breaking)**: Unbound now listens on port `53` (UDP/TCP) instead of `5353`.
42+
- Compose: the `unbound` service now requires `cap_add: [NET_BIND_SERVICE]` to bind <1024 as non-root.
43+
- Kubernetes: the `unbound` deployment exposes containerPorts `53/TCP` and `53/UDP` and adds the `NET_BIND_SERVICE` capability.
44+
- Rspamd and internal components should use `unbound:53`. Any hardcoded `:5353` must be updated.
45+
- If you previously customized Postfix to use `127.0.0.1:5353`, remove that customization. Postfix and other services should resolve via standard port 53.

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 53/TCP 53/UDP
13-
HEALTHCHECK CMD dig @127.0.0.1 -p 53 github.com || exit 1
13+
HEALTHCHECK CMD /usr/local/bin/healthcheck.sh
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# 1. test connection to 0.0.0.0:53 (UDP via dig) and TCP via nc
5+
if ! dig @127.0.0.1 -p 53 github.com +time=2 +tries=1 +short >/dev/null 2>&1; then
6+
echo "Healthcheck failed: dig to 127.0.0.1:53"
7+
exit 1
8+
fi
9+
10+
if ! nc -z 0.0.0.0 53; then
11+
echo "Healthcheck failed: cannot connect to 0.0.0.0:53 (TCP)"
12+
exit 1
13+
fi
14+
15+
echo "Healthcheck passed"
16+
exit 0
17+

0 commit comments

Comments
 (0)