Octelium provides a L-7 aware DNS mode where you can provide secure access to internal as well as public, including commercial, DNS servers with application-layer aware access control and visibility (read more about the DNS mode here). For example, you can very easily deploy and serve a Pi-hole container (read more about managed containers here) as a Service as follows:
1kind: Service2metadata:3name: pihole4spec:5mode: DNS6config:7upstream:8container:9port: 5310image: pihole/pihole:latest11env:12- name: FTLCONF_dns_listeningMode13value: all
You can now apply the creation of the Service as follows (read more here):
octeliumctl apply /PATH/TO/SERVICE.YAML
Once connected to the Cluster via octelium connect
(read more here), you can now test the DNS server pihole
, for example, as follows:
dig @pihole google.com
It's noteworthy to point out that the Cluster's DNS Server which resolves DNS queries for the all connected Users (read more here) is itself a DNS Service with the name dns.octelium
. This DNS server can additionally resolve queries outside the Cluster domain by proxying the requests to fallback servers that can be set via the ClusterConfig (read more here). We can, for example, deploy a Pi-hole server as a typical Kubernetes service and serve it as a fallback server to control and secure DNS queries for all connected octelium
clients as follow:
1apiVersion: apps/v12kind: Deployment3metadata:4name: pihole5spec:6selector:7matchLabels:8app: pihole9template:10metadata:11labels:12app: pihole13spec:14containers:15- name: pihole16image: pihole/pihole:latest17ports:18- containerPort: 5319protocol: UDP20env:21- name: FTLCONF_dns_listeningMode22value: all23---24apiVersion: v125kind: Service26metadata:27name: pihole28spec:29selector:30app: pihole31ports:32- name: dns33port: 5334targetPort: 5335protocol: UDP
You can now apply the creation of the deployment and service via kubectl apply
as follows:
kubectl apply -f PATH/TO/K8S_RESOURCES.YAML
Now we finally refer to the Kubernetes service as a fallback upstream as follows:
1kind: ClusterConfig2metadata:3name: default4spec:5dns:6fallbackZone:7servers:8- dns://pihole.default.svc
And as always, you apply the changes via octelium apply
.