Browse Source

dnsmasq listens on localhost

pull/70/head
Smaine Kahlouch 8 years ago
parent
commit
f58b4d3dd6
2 changed files with 5 additions and 4 deletions
  1. 7
      roles/dnsmasq/tasks/main.yml
  2. 2
      roles/dnsmasq/templates/dnsmasq-pod.yml

7
roles/dnsmasq/tasks/main.yml

@ -63,22 +63,21 @@
- name: Add search resolv.conf - name: Add search resolv.conf
lineinfile: lineinfile:
line: search {{ [ 'default.svc.' + dns_domain, 'svc.' + dns_domain, dns_domain ] | join(' ') }}
line: "search {{ [ 'default.svc.' + dns_domain, 'svc.' + dns_domain, dns_domain ] | join(' ') }}"
dest: "{{resolvconffile}}" dest: "{{resolvconffile}}"
state: present state: present
insertbefore: BOF insertbefore: BOF
backup: yes backup: yes
follow: yes follow: yes
- name: Add all masters as nameserver
- name: Add local dnsmasq to resolv.conf
lineinfile: lineinfile:
line: nameserver {{ hostvars[item]['ansible_default_ipv4']['address'] }}
line: "nameserver 127.0.0.1"
dest: "{{resolvconffile}}" dest: "{{resolvconffile}}"
state: present state: present
insertafter: "^search.*$" insertafter: "^search.*$"
backup: yes backup: yes
follow: yes follow: yes
with_items: groups['kube-master']
- name: Add options to resolv.conf - name: Add options to resolv.conf
lineinfile: lineinfile:

2
roles/dnsmasq/templates/dnsmasq-pod.yml

@ -29,9 +29,11 @@ spec:
- name: dns - name: dns
containerPort: 53 containerPort: 53
hostPort: 53 hostPort: 53
hostIP: 127.0.0.1
protocol: UDP protocol: UDP
- name: dns-tcp - name: dns-tcp
containerPort: 53 containerPort: 53
hostIP: 127.0.0.1
hostPort: 53 hostPort: 53
protocol: TCP protocol: TCP
volumeMounts: volumeMounts:

Loading…
Cancel
Save