Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Master: Add DnsMasq (node local resolver) command-line arguments/options #1527

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions builtin/files/cluster.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,10 @@ kubeDns:
# When enabled, will enable a DNS-masq DaemonSet to make PODs to resolve DNS names via locally running dnsmasq
# It is disabled by default.
# nodeLocalResolver: false
# Extra DnsMasq options to use when running the nodeLocalResolver
# nodeLocalResolverOptions:
# - --neg-ttl=10
# - --no-ping

# When enabled, will deploy kube-dns to K8s controllers instead of workers.
# deployToControllers: false
Expand Down
6 changes: 6 additions & 0 deletions builtin/files/userdata/cloud-config-controller
Original file line number Diff line number Diff line change
Expand Up @@ -3625,10 +3625,16 @@ write_files:
- -k
- --min-port=1024
- --cache-size=1000
- --server=//{{.DNSServiceIP}}
- --server=/cluster.local/{{.DNSServiceIP}}
- --server=/in-addr.arpa/{{.DNSServiceIP}}
- --server=/ip6.arpa/{{.DNSServiceIP}}
- --log-facility=-
{{- if ne (len .KubeDns.NodeLocalResolverOptions) 0 }}
{{- range .KubeDns.NodeLocalResolverOptions }}
- {{.}}
{{- end }}
{{- end }}
ports:
- containerPort: 53
name: dns
Expand Down
9 changes: 5 additions & 4 deletions pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,11 @@ type KubeDnsAutoscaler struct {
}

type KubeDns struct {
Provider string `yaml:"provider"`
NodeLocalResolver bool `yaml:"nodeLocalResolver"`
DeployToControllers bool `yaml:"deployToControllers"`
Autoscaler KubeDnsAutoscaler `yaml:"autoscaler"`
Provider string `yaml:"provider"`
NodeLocalResolver bool `yaml:"nodeLocalResolver"`
NodeLocalResolverOptions []string `yaml:"nodeLocalResolverOptions"`
DeployToControllers bool `yaml:"deployToControllers"`
Autoscaler KubeDnsAutoscaler `yaml:"autoscaler"`
}

func (c *KubeDns) MergeIfEmpty(other KubeDns) {
Expand Down