I want to create a bind9 service running as a daemonset on my rke2 v1.24.9+rke2r1 cluster. The service should be available through a single IP address to hosts on my local area network. I don’t need load balancing (load will always be low) but I want redundancy so that if I reboot a node or two, the name resolution service will continue to work from one of the remaining nodes.
Should I use rke2-ingress-nginx for this? All the tutorials and examples for ingress and load balancers use http/https and nginx is a web server so I’m not sure whether nginx is the right tool. Below is my .yaml config.
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: bind
namespace: bind9
labels:
app: bind
spec:
replicas: 5
selector:
matchLabels:
app: bind
template:
metadata:
labels:
app: bind
spec:
containers:
- name: bind
image: sameersbn/bind
env:
- name: ROOT_PASSWORD
value: "gotchaLookin'"
volumeMounts:
- mountPath: /data
name: data
ports:
- containerPort: 53
protocol: UDP
- containerPort: 53
protocol: TCP
- containerPort: 10000
volumes:
- name: data
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: bind-dns
labels:
name: bind-dns
spec:
type: ClusterIP
ports:
- name: dns-udp
port: 53
targetPort: 53
protocol: UDP
- name: dns-tcp
port: 53
protocol: TCP
targetPort: 53
selector:
app: bind
kub get pods -n bind9
NAME READY STATUS RESTARTS AGE
bind-7f946ddd65-9qm7f 1/1 Running 0 22h
bind-7f946ddd65-bpbvv 1/1 Running 0 22h
bind-7f946ddd65-fm89p 1/1 Running 0 22h
bind-7f946ddd65-hvrsv 1/1 Running 0 22h
bind-7f946ddd65-mjxcm 1/1 Running 0 22h