Skip to content

Instantly share code, notes, and snippets.

@bowei
Last active March 3, 2017 23:08
Show Gist options
  • Save bowei/978dfc27beb0ceff7bf607a7f5380fda to your computer and use it in GitHub Desktop.
Save bowei/978dfc27beb0ceff7bf607a7f5380fda to your computer and use it in GitHub Desktop.
# Replace dnsmasq spec in the kube-dns pod (see kubectl get -n kube-system kube-dns -o yaml)
# Make sure you replace cluster.local below.
name: dnsmasq
image: gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.0
livenessProbe:
httpGet:
path: /healthcheck/dnsmasq
port: 10054
scheme: HTTP
initialDelaySeconds: 60
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 5
args:
- -v=2
- -logtostderr
- -configDir=/etc/k8s/dns/dnsmasq-nanny
- -restartDnsmasq=true
- --
- -k
- --cache-size=1000
- --log-facility=-
- --server=/cluster.local/127.0.0.1#10053 # Replace with your cluster domain
- --server=/in-addr.arpa/127.0.0.1#10053
- --server=/ip6.arpa/127.0.0.1#10053
ports:
- containerPort: 53
name: dns
protocol: UDP
- containerPort: 53
name: dns-tcp
protocol: TCP
resources:
requests:
cpu: 150m
memory: 20Mi
volumeMounts:
- name: kube-dns-config
mountPath: /etc/k8s/dns/dnsmasq-nanny 
# Volume mount for the config map if it didn't not already exist
volumes:
- configMap:
defaultMode: 420
name: kube-dns
# optional: true
name: kube-dns-config
# kubectl create -f kube-dns.yaml
apiVersion: v1
kind: ConfigMap
data:
stubDomains: |
{"acme.local":["1.2.3.4"]}
upstreamNameservers: |
["8.8.8.8", "8.8.4.4"]
metadata:
name: kube-dns
namespace: kube-system
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment