Skip to content

Instantly share code, notes, and snippets.

@miekg
Created January 13, 2018 10:31
Show Gist options
  • Save miekg/85a27e7bd60d5c156c705e8f7eed3a97 to your computer and use it in GitHub Desktop.
Save miekg/85a27e7bd60d5c156c705e8f7eed3a97 to your computer and use it in GitHub Desktop.
CoreDNS kubernetes deployment yaml
apiVersion: v1
kind: Service
metadata:
name: coredns
spec:
ports:
- name: coredns
port: 53
protocol: UDP
targetPort: 53
selector:
app: coredns
type: LoadBalancer
loadBalancerIP: 192.168.1.252
---
apiVersion: v1
kind: ConfigMap
metadata:
name: coredns
data:
Corefile: |
. {
errors
log
debug
health
prometheus 0.0.0.0:9153
forward . tls://9.9.9.9 {
except raspberrypi higgs libreelec gluon brik flo master node0 node1 node2
tls_servername dns.quad9.net
health_check 5s
}
cache 30
}
raspberrypi higgs libreelec gluon brik flo master node0 node1 node2 {
forward . 192.168.1.1:53 {
health_check 0
}
cache 30
prometheus
log
errors
}
whoami.cluster.local {
log
errors
debug
whoami
prometheus
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: coredns-deployment
labels:
app: coredns
spec:
replicas: 4
selector:
matchLabels:
app: coredns
template:
metadata:
labels:
app: coredns
spec:
containers:
- name: coredns
image: miek/coredns:0.8
imagePullPolicy: IfNotPresent
args: [ "-conf", "/etc/coredns/Corefile" ]
volumeMounts:
- name: config-volume
mountPath: /etc/coredns
ports:
- containerPort: 53
name: dns
protocol: UDP
- containerPort: 53
name: dns-tcp
protocol: TCP
- containerPort: 9153
name: metrics
protocol: TCP
volumes:
- name: config-volume
configMap:
name: coredns
items:
- key: Corefile
path: Corefile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment