mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-29 22:49:17 +00:00
Add kube-dns/CoreDNS documentation
This commit is contained in:
committed by
Denise Schannon
parent
13d88761d5
commit
0b80d6a698
@@ -162,3 +162,14 @@ pod "kube-dns-5fd74c7488-6pwsf" deleted
|
|||||||
```
|
```
|
||||||
|
|
||||||
Try to resolve name again using [Check if domain names are resolving](#check-if-domain-names-are-resolving).
|
Try to resolve name again using [Check if domain names are resolving](#check-if-domain-names-are-resolving).
|
||||||
|
|
||||||
|
If you want to check the kube-dns configuration in your cluster (for example, to check if there are different upstream nameservers configured), you can run the following command to list the kube-dns configuration:
|
||||||
|
|
||||||
|
```
|
||||||
|
kubectl -n kube-system get configmap kube-dns -o go-template='{{range $key, $value := .data}}{{ $key }}{{":"}}{{ $value }}{{"\n"}}{{end}}'
|
||||||
|
```
|
||||||
|
|
||||||
|
Example output:
|
||||||
|
```
|
||||||
|
upstreamNameservers:["1.1.1.1"]
|
||||||
|
```
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ RKE supports pluggable add-ons. Add-ons are used to deploy several cluster compo
|
|||||||
|
|
||||||
* [Network plug-ins]({{< baseurl >}}/rke/v0.1.x/en/config-options/add-ons/network-plugins/)
|
* [Network plug-ins]({{< baseurl >}}/rke/v0.1.x/en/config-options/add-ons/network-plugins/)
|
||||||
* [Ingress controller]({{< baseurl >}}/rke/v0.1.x/en/config-options/add-ons/ingress-controllers/)
|
* [Ingress controller]({{< baseurl >}}/rke/v0.1.x/en/config-options/add-ons/ingress-controllers/)
|
||||||
* KubeDNS
|
* [DNS provider]({{< baseurl >}}/rke/v0.1.x/en/config-options/add-ons/dns/)
|
||||||
|
|
||||||
The images used for these add-ons under the [`system_images` directive]({{< baseurl >}}/rke/v0.1.x/en/config-options/system-images/). For each Kubernetes version, there are default images associated with each add-on, but these can be overridden by changing the image tag in `system_images`.
|
The images used for these add-ons under the [`system_images` directive]({{< baseurl >}}/rke/v0.1.x/en/config-options/system-images/). For each Kubernetes version, there are default images associated with each add-on, but these can be overridden by changing the image tag in `system_images`.
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
---
|
||||||
|
title: DNS provider
|
||||||
|
weight: 262
|
||||||
|
---
|
||||||
|
|
||||||
|
By default, RKE deploys [kube-dns](https://github.com/kubernetes/dns) as DNS provider for your cluster.
|
||||||
|
|
||||||
|
RKE will deploy kube-dns as a Deployment with the default replica count of 1. The pod consists of 3 containers: `kubedns`, `dnsmasq` and `sidecar`. RKE will also deploy kube-dns-autoscaler as a Deployment, which will scale the kube-dns Deployment by using the number of cores and nodes. Please see [Linear Mode](https://github.com/kubernetes-incubator/cluster-proportional-autoscaler#linear-mode) for more information about this logic.
|
||||||
|
|
||||||
|
The images used for kube-dns are under the [`system_images` directive]({{< baseurl >}}/rke/v0.1.x/en/config-options/system-images/). For each Kubernetes version, there are default images associated with kube-dns, but these can be overridden by changing the image tag in `system_images`.
|
||||||
|
|
||||||
|
## Scheduling kube-dns
|
||||||
|
|
||||||
|
If you only wanted ingress controllers to be deployed on specific nodes, you can set a `node_selector` for the ingress. The label in the `node_selector` would need to match the label on the nodes for the ingress controller to be deployed.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
nodes:
|
||||||
|
- address: 1.1.1.1
|
||||||
|
role: [controlplane,worker,etcd]
|
||||||
|
user: root
|
||||||
|
labels:
|
||||||
|
app: dns
|
||||||
|
|
||||||
|
dns:
|
||||||
|
provider: kube-dns
|
||||||
|
node_selector:
|
||||||
|
app: dns
|
||||||
|
```
|
||||||
|
|
||||||
|
## Disabling kube-dns
|
||||||
|
|
||||||
|
You can disable the default DNS provider by specifying `none` to the dns `provider` directive in the cluster configuration. Be aware that this will prevent your pods from doing name resolution in your cluster.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
dns:
|
||||||
|
provider: none
|
||||||
|
```
|
||||||
|
## Configuring kube-dns
|
||||||
|
|
||||||
|
### Upstream nameservers
|
||||||
|
|
||||||
|
By default, kube-dns will use the host configured nameservers (usually residing at `/etc/resolv.conf`) to resolve external queries. If you want to configure specific upstream nameservers to be used by kube-dns, you can use the `upstreamnameservers` directive.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
dns:
|
||||||
|
provider: kube-dns
|
||||||
|
upstreamnameservers:
|
||||||
|
- 1.1.1.1
|
||||||
|
- 8.8.4.4
|
||||||
|
```
|
||||||
|
|
||||||
|
## CoreDNS (experimental)
|
||||||
|
|
||||||
|
<p>Experimental support for CoreDNS is available in RKE v0.2.0 and later.</p>
|
||||||
|
|
||||||
|
If you want to use CoreDNS, you can set the `provider` directive to `coredns`. Both the `node_selector` and `upstreamnameservers` directive is also supported for CoreDNS.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
dns:
|
||||||
|
provider: coredns
|
||||||
|
upstreamnameservers:
|
||||||
|
- 1.1.1.1
|
||||||
|
- 8.8.4.4
|
||||||
|
```
|
||||||
@@ -6,7 +6,7 @@ When RKE is deploying Kubernetes, there are several images that are pulled. Thes
|
|||||||
|
|
||||||
As of `v0.1.6`, the functionality of a couple of the system images were consolidated into a single `rancher/rke-tools` image to simplify and speed the deployment process.
|
As of `v0.1.6`, the functionality of a couple of the system images were consolidated into a single `rancher/rke-tools` image to simplify and speed the deployment process.
|
||||||
|
|
||||||
You can configure the [network plug-ins]({{< baseurl >}}/rke/v0.1.x/en/config-options/add-ons/network-plugins/) and [ingress controller]({{< baseurl >}}/rke/v0.1.x/en/config-options/add-ons/ingress-controllers/) as well as the options for these add-ons separately.
|
You can configure the [network plug-ins]({{< baseurl >}}/rke/v0.1.x/en/config-options/add-ons/network-plugins/), [ingress controller]({{< baseurl >}}/rke/v0.1.x/en/config-options/add-ons/ingress-controllers/) and [dns provider]({{< baseurl >}}/rke/v0.1.x/en/config-options/add-ons/dns/) as well as the options for these add-ons separately.
|
||||||
|
|
||||||
This is the example of the full list of system images used to deploy Kubernetes through RKE. The image tags are dependent on the [Kubernetes image/version used](https://github.com/rancher/types/blob/master/apis/management.cattle.io/v3/k8s_defaults.go).
|
This is the example of the full list of system images used to deploy Kubernetes through RKE. The image tags are dependent on the [Kubernetes image/version used](https://github.com/rancher/types/blob/master/apis/management.cattle.io/v3/k8s_defaults.go).
|
||||||
|
|
||||||
@@ -14,39 +14,49 @@ This is the example of the full list of system images used to deploy Kubernetes
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
system_images:
|
system_images:
|
||||||
kubernetes: rancher/hyperkube:v1.10.3-rancher2
|
etcd: rancher/coreos-etcd:v3.2.24
|
||||||
etcd: rancher/coreos-etcd:v3.1.12
|
alpine: rancher/rke-tools:v0.1.24
|
||||||
alpine: rancher/rke-tools:v0.1.9
|
nginx_proxy: rancher/rke-tools:v0.1.24
|
||||||
nginx_proxy: rancher/rke-tools:v0.1.9
|
cert_downloader: rancher/rke-tools:v0.1.24
|
||||||
cert_downloader: rancher/rke-tools:v0.1.9
|
kubernetes: rancher/hyperkube:v1.13.1-rancher1
|
||||||
kubernetes_services_sidecar: rancher/rke-tools:v0.1.9
|
kubernetes_services_sidecar: rancher/rke-tools:v0.1.24
|
||||||
kubedns: rancher/k8s-dns-kube-dns-amd64:1.14.8
|
pod_infra_container: rancher/pause-amd64:3.1
|
||||||
dnsmasq: rancher/k8s-dns-dnsmasq-nanny-amd64:1.14.8
|
|
||||||
kubedns_sidecar: rancher/k8s-dns-sidecar-amd64:1.14.8
|
|
||||||
kubedns_autoscaler: rancher/cluster-proportional-autoscaler-amd64:1.0.0
|
|
||||||
pod_infra_container: rancher/pause-amd64:3.1
|
|
||||||
|
|
||||||
# Flannel Networking Options
|
# kube-dns images
|
||||||
flannel: rancher/coreos-flannel:v0.9.1
|
kubedns: rancher/k8s-dns-kube-dns-amd64:1.15.0
|
||||||
flannel_cni: rancher/coreos-flannel-cni:v0.2.0
|
dnsmasq: rancher/k8s-dns-dnsmasq-nanny-amd64:1.15.0
|
||||||
|
kubedns_sidecar: rancher/k8s-dns-sidecar-amd64:1.15.0
|
||||||
|
kubedns_autoscaler: rancher/cluster-proportional-autoscaler-amd64:1.0.0
|
||||||
|
|
||||||
# Calico Networking Options
|
# CoreDNS images
|
||||||
calico_node: rancher/calico-node:v3.1.1
|
coredns: coredns/coredns:1.2.6
|
||||||
calico_cni: rancher/calico-cni:v3.1.1
|
coredns_autoscaler: rancher/cluster-proportional-autoscaler-amd64:1.0.0
|
||||||
calico_ctl: rancher/calico-ctl:v2.0.0
|
|
||||||
|
|
||||||
# Canal Networking Options
|
# Flannel images
|
||||||
canal_node: rancher/calico-node:v3.1.1
|
flannel: rancher/coreos-flannel:v0.10.0
|
||||||
canal_cni: rancher/calico-cni:v3.1.1
|
flannel_cni: rancher/coreos-flannel-cni:v0.3.0
|
||||||
canal_flannel: rancher/coreos-flannel:v0.9.1
|
|
||||||
|
|
||||||
# Weave Networking Options
|
# Calico images
|
||||||
weave_node: weaveworks/weave-kube:2.1.2
|
calico_node: rancher/calico-node:v3.4.0
|
||||||
weave_cni: weaveworks/weave-npc:2.1.2
|
calico_cni: rancher/calico-cni:v3.4.0
|
||||||
|
calico_controllers: ""
|
||||||
|
calico_ctl: rancher/calico-ctl:v2.0.0
|
||||||
|
|
||||||
# Ingress Options
|
# Canal images
|
||||||
ingress: rancher/nginx-ingress-controller:0.10.2-rancher3
|
canal_node: rancher/calico-node:v3.4.0
|
||||||
ingress_backend: rancher/nginx-ingress-controller-defaultbackend:1.4
|
canal_cni: rancher/calico-cni:v3.4.0
|
||||||
|
canal_flannel: rancher/coreos-flannel:v0.10.0
|
||||||
|
|
||||||
|
# Weave images
|
||||||
|
weave_node: weaveworks/weave-kube:2.5.0
|
||||||
|
weave_cni: weaveworks/weave-npc:2.5.0
|
||||||
|
|
||||||
|
# Ingress controller images
|
||||||
|
ingress: rancher/nginx-ingress-controller:0.21.0-rancher1
|
||||||
|
ingress_backend: rancher/nginx-ingress-controller-defaultbackend:1.4
|
||||||
|
|
||||||
|
# Metrics server image
|
||||||
|
metrics_server: rancher/metrics-server-amd64:v0.3.1
|
||||||
```
|
```
|
||||||
|
|
||||||
Prior to `v0.1.6`, instead of using the `rancher/rke-tools` image, we used the following images:
|
Prior to `v0.1.6`, instead of using the `rancher/rke-tools` image, we used the following images:
|
||||||
|
|||||||
Reference in New Issue
Block a user