CoreDNS Description
Component introduction
CoreDNS provides domain name resolution capabilities for internal services within a Kubernetes cluster. There is a corresponding relationship between CoreDNS version and Kubernetes version. When creating and upgrading your cluster, a compatible version of CoreDNS will be installed for you in accordance with the version correspondence specified in the CoreDNS version in Kubernetes. For more information about the version correspondence, please refer to CoreDNS version in Kubernetes.
Instructions for use
CoreDNS is configured in the kube-system namespace by default. For details on how to view and modify CoreDNS configuration items in a K8S Cluster CCE, please refer to Manual Upgrade Guide for CoreDNS Component. CoreDNS enables and configures plugins based on these configuration items. It should be emphasized that configuration items vary slightly across different CoreDNS versions. Before modifying configurations, please carefully read the Official CoreDNS Document and Manual Upgrade Guide for CoreDNS Component. The following is the default configuration file for CoreDNS version 1.20.3:
1 .:53 {
2 errors
3 health {
4 lameduck 10s
5 }
6 ready
7 log
8 kubernetes {{.ClusterDomain}} in-addr.arpa ip6.arpa {
9 pods insecure
10 fallthrough in-addr.arpa ip6.arpa
11 ttl 30
12 }
13 prometheus :9153
14 forward . /etc/resolv.conf
15 cache 30
16 loop
17 reload
18 loadbalance
19 }
Description: In the configuration file, ClusterDomain refers to the local cluster domain name specified during cluster creation, with a default value of cluster.local.
| Parameters | Description |
|---|---|
| errors | Error messages are directed to Stdout. |
| health | CoreDNS reports health status and listens on port 8080 by default (usually used for health checks). Health status can be accessed via http://localhost:8080/health. |
| ready | CoreDNS reports plugin status, listening on port 8181 by default (commonly used for readiness checks). Readiness status can be accessed via http://localhost:8181/ready. If all plugins are running, the status will show as 200. |
| kubernetes | The CoreDNS Kubernetes plugin offers resolution for in-cluster services. |
| prometheus | CoreDNS provides its own metrics data interface. Monitoring data in Prometheus format can be accessed via http://localhost:9153/metrics. |
| forward (or proxy) | Forwards domain name queries to predefined DNS servers. By default, when the domain name isn't part of the Kubernetes domain, requests are forwarded to preconfigured resolvers (/etc/resolv.conf). The host's /etc/resolv.conf configuration is used by default. |
| cache | Enables DNS caching. |
| loop | Loop detection: If a loop is detected, CoreDNS will stop running. |
| reload | Supports automatic reloading of updated Corefiles. After editing the ConfigMap configuration, allow up to two minutes for the changes to take effect. |
| loadbalance | A round-robin DNS load balancer can randomize the order of A, AAAA, and MX records in its responses. |
Limitations
CoreDNS is a system component. Since upgrades may cause cluster-wide resolution timeouts or failures within 5 minutes, automatic upgrades via the console are not supported temporarily. Please arrange the upgrade time reasonably and perform a manual upgrade.
Install component
CoreDNS is installed by default when creating a cluster, so there’s no need to handle the installation process yourself.
- For K8S Cluster CCE with version ≥ 1.20, v1.20.2 is deployed by default, and the image version is 1.9.4-baidu
- For K8S Cluster CCE with version < 1.20, v1.0.0 is deployed by default, and the image version is 1.7.1
Version records
| Version No. | Image version | Cluster version compatibility | Update time | Update content | Impact |
|---|---|---|---|---|---|
| 1.20.4 | 1.9.4-baidu-1 | CCE/v1.20/v1.22/v1.22/v1.26 | 2024.07.02 | Disable wildcard query function | -- |
| 1.20.3 | 1.9.4-baidu | CCE/v1.20/v1.22/v1.22/v1.26 | 2024.02.06 | Expose ConfigMap parameters | -- |
| 1.20.2 | 1.9.4-baidu | CCE/v1.20/v1.22/v1.22/v1.26 | 2024.01.08 | Support high-version clusters | -- |
| 1.0.0 | 1.7.1 | CCE/v1.18 | 2022.06.21 | First release | -- |
