Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
3237b270
Unverified
Commit
3237b270
authored
5 years ago
by
Mateus Caruccio
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add config coredns_external_zones (#5280)
Allows to add custom zone resolving servers.
parent
e8c49b00
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/dns-stack.md
+30
-0
30 additions, 0 deletions
docs/dns-stack.md
roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2
+12
-0
12 additions, 0 deletions
...s/kubernetes-apps/ansible/templates/coredns-config.yml.j2
with
42 additions
and
0 deletions
docs/dns-stack.md
+
30
−
0
View file @
3237b270
...
...
@@ -42,6 +42,36 @@ DNS servers in early cluster deployment when no cluster DNS is available yet.
## DNS modes supported by Kubespray
### coredns_external_zones
Array of optional external zones to coredns forward queries to. It's injected into
`coredns`
' config file before default kubernetes zone. Use it as an optimization for well-known zones and/or internal-only
domains, i.e. VPN for internal networks (default is unset)
Example:
```
yaml
coredns_external_zones
:
-
zones
:
-
example.com
-
example.io:1053
nameservers
:
-
1.1.1.1
-
2.2.2.2
cache
:
5
-
zones
:
-
https://mycompany.local:4453
nameservers
:
-
192.168.0.53
cache
:
0
```
or as INI
```
ini
coredns_external_zones
=
[{"cache": 30,"zones":["example.com","example.io:453"],"nameservers":["1.1.1.1","2.2.2.2"]}]'
```
You can modify how Kubespray sets up DNS for your cluster with the variables
``dns_mode``
and
``resolvconf_mode``
.
### dns_mode
...
...
This diff is collapsed.
Click to expand it.
roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2
+
12
−
0
View file @
3237b270
...
...
@@ -8,6 +8,18 @@ metadata:
addonmanager.kubernetes.io/mode: EnsureExists
data:
Corefile: |
{% if coredns_external_zones is defined and coredns_external_zones|length > 0 %}
{% for block in coredns_external_zones %}
{{ block['zones'] | join(' ') }} {
log
errors
forward . {{ block['nameservers'] | join(' ') }}
loadbalance
cache {{ block['cache'] | default(5) }}
reload
}
{% endfor %}
{% endif %}
.:53 {
errors
health
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment