coredns / coredns/helm

Add additional server without overwriting the default one

Open
#75 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Mustache
Stars
146
Forks
145
Avg merge
6d 5h
Merged PRs (30d)
2

Description

Is it somehow possible to add an additional server to the `Corefile` without overwriting the default server?

The default values for `servers` are:

```yaml
servers:
- zones:
- zone: .
port: 53
# If serviceType is nodePort you can specify nodePort here
# nodePort: 30053
plugins:
- name: errors
# Serves a /health endpoint on :8080, required for livenessProbe
- name: health
configBlock: |-
lameduck 5s
# Serves a /ready endpoint on :8181, required for readinessProbe
- name: ready
# Required to query kubernetes API for data
- name: kubernetes
parameters: cluster.local in-addr.arpa ip6.arpa
configBlock: |-
pods insecure
fallthrough in-addr.arpa ip6.arpa
ttl 30
# Serves a /metrics endpoint on :9153, required for serviceMonitor
- name: prometheus
parameters: 0.0.0.0:9153
- name: forward
parameters: . /etc/resolv.conf
- name: cache
parameters: 30
- name: loop
- name: reload
- name: loadbalance
```

With this config the ConfigMap with the `Corefile` looks like this:

```yaml
apiVersion: v1
kind: ConfigMap
data:
Corefile: |-
.:53 {
errors
health {
lameduck 5s
}
ready
kubernetes cluster.local cluster.local in-addr.arpa ip6.arpa {
pods insecure
fallthrough in-addr.arpa ip6.arpa
ttl 30
}
prometheus 0.0.0.0:9153
forward . /etc/resolv.conf
cache 30
loop
reload
loadbalance
}
```

I want to add one additional hosts, so that it looks somewhat like this:

```yaml
apiVersion: v1
kind: ConfigMap
data:
Corefile: |-
.:53 {
errors
health {
lameduck 5s
}
ready
kubernetes cluster.local cluster.local in-addr.arpa ip6.arpa {
pods insecure
fallthrough in-addr.arpa ip6.arpa
ttl 30
}
prometheus 0.0.0.0:9153
forward . /etc/resolv.conf
cache 30
loop
reload
loadbalance
}
my-internal-domain.com:53 {
hosts {
10.20.30.40 my-service.my-internal-domain.com
fallthrough
}
}
```

Unfortunately the nameserver that is provided by the `/etc/resolv.conf` must not resolve this host. And running my own nameserver on the host (with `dnsmasq`) does not work well together with CoreDNS.

I got tat least the deployment working by adding another `zoneFile`. It was successfully mounted to the container, but the name did not resolve afterwards. Maybe I need to _register_ it somewhere?

Thanks in advance!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.