DNS is the foundation of service discovery in Kubernetes clusters, and the performance and stability of cluster DNS service discovery are closely related to application quality. This topic describes how to configure DNS service observability.
Background information
In large-scale scenarios, a large number of DNS requests can put significant pressure on DNS add-ons in the cluster, which causes increased DNS latency and subsequent impact on application performance. Therefore, you need to leverage the cluster observability capabilities to promptly gain insights into the operational status of the DNS add-ons in the cluster, receive alerts, and take corrective actions when necessary.
VKE supports the CoreDNS add-on and the NodeLocal DNSCache add-on. They offer standard cluster DNS service discovery and node DNS cache proxy capabilities. The relevant add-ons include:
- core-dns. The CoreDNS add-on delivers service discovery and domain name resolution services for the internal environment of the cluster.
- node-local-dns. The NodeLocal DNSCache add-on (a caching solution) provides DNS cache proxy capabilities for nodes, improving the performance and stability of DNS service discovery across the entire cluster.
Prerequisites
Step 1: Configure observability items
- In the left navigation bar, click Cluster. Find the target cluster and click its name.
- In the left navigation pane of the cluster management page, click Observability settings, and select the Basic observability tab.
- Find the DNS service card and click Enable observation to go to the observability item configuration page.
- The system automatically checks the necessary conditions for enabling observability, such as the workspace configuration and add-on status.
- For the Observation item parameter, select observability items for which you want to collect metrics. For items for which metric collection is not enabled, the system will not collect the corresponding metrics, and the system will prompt you to install the related add-ons. You can decide whether to install the related add-ons and select the corresponding observability items based on your business requirements.
- After the configuration is complete, click Next to go to the metric configuration page.
Step 2: Configure metric collection
- On the metric configuration page, view the collection interval and metric quantity corresponding to the enabled observability items.
- Click Edit metrics. This enables you to select or discard specific metrics of the add-on, modify the collection interval, and configure metric relabeling.
- For Collection interval, select a collection interval for the metrics of the add-on. The supported collection intervals vary for different add-ons.
- In the metric list, select a metric to collect. To stop collecting a metric, uncheck it. Click the All, Basic metrics, or Other metrics tab to filter metrics by type.
tip
- The impact of adjusting the metric collection interval is as follows. Adjust the interval as needed:
- Reducing the collection interval: This increases the number of metrics reported per unit time and improves monitoring accuracy. However, the cost of standard VMP workspaces increases.
- Increasing the collection interval: This decreases the number of metrics reported per unit time and lowers the cost of standard VMP workspaces. However, this decreases monitoring accuracy.
- Cloud service metrics are categorized into Basic metrics and Other metrics. The billing method varies based on different types of metrics. For details, see VMP billing.
- In the metricRelabelings section, click Add rule to configure metric relabeling rules. This allows you to rewrite the labels of each metric after collection and before writing to storage. Common use cases include modifying label values, adding new labels, and renaming labels to standardize label naming for queries. For details, see Metric relabeling.
- After the configuration is complete, click Next to go to the alert and notification configuration page.
Step 3: Configure alerts and notifications
- In the Alert and notification step, select the platform to receive alerts. Currently, Unified Alert Center and The original VMP alarm strategy are supported.
- For the Notification strategy name parameter, select the created alert notification policy and specify the notification object and Notification method parameters based on different alert levels.
tip
- If you do not need to configure alerts for a certain level, you can unselect the corresponding alert level.
- If the existing notification policies do not meet your needs, you can select vke_default_notify_policy (automatically created) for the Notification strategy name parameter, and specify the notification object and Notification method parameters for the required alert levels. After you save the configuration, the system will automatically create a custom notification policy named vke_default_notify_policy in the unified Alert Center or VMP.
- In the Alerting aggregation policy section, select the created alert aggregation policy.
- Configure preset alert rules.
- Enable or disable the switch next to a preset alert rule. After it is enabled, the system detects metrics based on the configured trigger conditions and generates alerts. When it is disabled, the rule will no longer trigger new alerts.
- Click View PromQL to view the description and corresponding PromQL statement of the current preset alert rule.
- Click the name of the preset rule that you want to configure to expand the preset alert rule configuration page, and configure the trigger conditions for alerts of different levels (P0, P1, or P2) in the Triggering condition section.
- Click Complete the configuration.
Description
- In addition to using preset alert templates to configure alert rules directly, you can customize the template configurations or directly use PromQL statements to configure alert rules. For details, see Alert configuration overview.
- Details of the preset alert rule templates, including rule descriptions, PromQL configurations, and common alert handling procedures. See Preset alert templates.
Observability dashboards
tip
The built-in dashboards provide features such as period-over-period comparisons of monitoring data and the ability to copy dashboard queries. For details, see Usage of dashboards. core-dns monitoring
You can query the monitoring information for all or specified core-dns instances. This information includes DNS requests, DNS error rates, DNS forwarding, and DNS cache hit rates. You can specify a custom time range for querying information and set the information refresh mode to manual refresh or automatic refresh.
- In the left navigation pane of the cluster management page, click Monitoring center > Dashboard.
- In the left dashboard list, click Network services monitoring > Core-DNS monitoring to view the monitoring dashboard.
node-local-dns monitoring
You can query the monitoring information for all or specified node-local-dns instances. This information includes DNS requests, DNS error rates, DNS forwarding, and DNS cache hit rates. You can specify a custom time range for querying information and set the information refresh mode to manual refresh or automatic refresh.
- In the left navigation pane of the cluster management page, click Monitoring center > Dashboard.
- In the left dashboard list, click Network services monitoring > Node-local-dns monitoring to view the monitoring dashboard.
View metrics
- To query integrated or non-integrated metrics in the cluster, or to understand metric meanings, see Querying metrics.
- You can use the Explore feature of VMP to quickly query and display metric data. For details, see Querying metrics.