Hi! I'm trying to get pihole working as a DNS server on port 53/udp and 53/tcp in K3s and got stuck with the following problem regarding traefik.
To isolate the problem, instead of using the pihole image, I used one that contains a simple UDP echo server to test the connection.
First the setup where the DNS requests work via udp:
Here is my echo server:
apiVersion: apps/v1
kind: Deployment
metadata:
name: udplog
labels:
app: udplog
spec:
replicas: 1
selector:
matchLabels:
app: udplog
template:
metadata:
labels:
app: udplog
spec:
containers:
- name: udplog
image: mendhak/udp-listener
env:
- name: UDPPORT
value: "53"
ports:
- containerPort: 53
protocol: UDP
And here is my service:
apiVersion: v1
kind: Service
metadata:
name: udplog-service
spec:
selector:
app: udplog
ports:
- port: 53
protocol: UDP
The udp port is exposed with this HelmChartConfig:
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
name: traefik
namespace: kube-system
spec:
valuesContent: |-
additionalArguments:
- "--entryPoints.dnsudp.address=:53/udp"
ports:
dnsudp:
port: 53
exposedPort: 53
expose: true
protocol: UDP
And here the IngressRouteUDP:
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteUDP
metadata:
name: udplog-ingressroute-udp
spec:
entryPoints:
- dnsudp
routes:
- services:
- name: udplog-service
port: 53
When I try to resolve a domain name, I see the requests in the log of the echo server. So far so good. But I also want to enable port 53/tcp:
I change the HelmChartConfig as follows to also expose port 53/tcp. But already after enabling these changes the communication via udp does not work anymore.
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
name: traefik
namespace: kube-system
spec:
valuesContent: |-
additionalArguments:
- "--entryPoints.dnsudp.address=:53/udp"
- "--entryPoints.dnstcp.address=:53/tcp"
ports:
dnsudp:
port: 53
exposedPort: 53
expose: true
protocol: UDP
dnstcp:
port: 53
exposedPort: 53
expose: true
protocol: TCP
What am I doing wrong?